21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
31 Reads the logfile noise written by cnntp-solver.pl. Does so backwards
32 because we are interested in the last run. Does so until it has
33 processed one complete block of anno-nnnn lines. Writes them to
34 stdout, adding and removing stuff.
36 Intended as a first step in cleaning up annotate.txt. We only extract
37 the distros that we believe should be eliminated. When we have
38 confidence that the list is OK, we pipe it in a separate step like so:
41 2015-10-03 02:46 ~/src/installed-perls/v5.16.0/4e6d/bin/perl bin/filter-outdated-from-analysis-logfile.pl bin/cnntp-solver.sh.out | tee ~/filter-outdated-from-analysis-logfile.out
44 2015-10-03 03:51 ssh andreas@analysis cat filter-outdated-from-analysis-logfile.out | perl bin/eliminate-outdated-annotations.pl
51 use lib
"$FindBin::Bin/../lib";
57 use File
::Basename
qw(dirname);
58 use File
::Path
qw(mkpath);
63 use Hash
::Util
qw(lock_keys);
66 lock_keys
%Opt, map { /([^=|!]+)/ } @opt;
74 my($logfile) = @ARGV or pod2usage
(1);
76 use File
::ReadBackwards
;
77 my $rb = File
::ReadBackwards
->new($logfile) or die;
79 # use Regexp::Debugger;
80 LINE
: while (defined(my $line = $rb->readline)) {
81 $line =~ s!\e\[3[12345](?:;\d+)?m(.*?)\e\[0m!$1!sg;
82 # 1503 anno-1508 13-02-05 252: 14: 4 SHARYANTO/Org-Parser-0.30 (<0.37)
83 my($cnt,$annolabel,$date,$passes,$fails,$unknowns,$author,$distv,$state) =
86 \s
+(\d
{2}-\d
{2}-\d
{2})
95 unless (defined $annoblock) {
96 $annoblock = $annolabel;
98 last LINE
unless $annolabel eq $annoblock;
100 printf "%-53s %s %-12s %-12s %4d\n", $distv, $annolabel, $author, $state, $cnt;
102 } elsif (defined $annoblock) {
103 if ($line =~ /Already up-to-date/) {
111 # cperl-indent-level: 4