21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
31 We are losing annotations somewhere.
33 I tried to find out whether a recalc enters the annotation like so:
35 ~/src/installed-perls/v5.16.0/4e6d/bin/perl bin/annotations-in-db.pl | awk '{print $1}' | while read d; do redis-cli zincrby analysis:jobqueue:q 1 $d; done
43 use lib
"$FindBin::Bin/../lib";
49 use File
::Basename
qw(dirname);
50 use File
::Path
qw(mkpath);
55 use Hash
::Util
qw(lock_keys);
58 lock_keys
%Opt, map { /([^=|!]+)/ } @opt;
66 open my $fh, "annotate.txt" or die "Could not open 'annotate.txt': $!";
69 tie
%$anno, 'Tie::IxHash';
70 ANNOLINE
: while (<$fh>) {
72 next ANNOLINE
if /^\s*$/;
73 my($dist,$splain) = split " ", $_, 2;
74 $anno->{$dist} = $splain;
78 my $dbi = DBI
->connect ("dbi:Pg:dbname=analysis");
79 my $sth = $dbi->prepare("SELECT yaml FROM distcontext WHERE distv=?");
80 ANNO
: for my $distv (keys %$anno) {
81 $sth->execute($distv);
82 if (my($yaml) = $sth->fetchrow_array) {
83 my $y = YAML
::Syck
::Load
($yaml);
84 if ($y->{annotation
} && $y->{annotation
} eq $anno->{$distv}) {
87 substr($anno->{$distv},38) = "..." if length $anno->{$distv}>41;
88 printf "%-38s %s\n", $distv, $anno->{$distv};
91 warn "==> not found in db: $distv\n";
97 # cperl-indent-level: 4