Joey Hess wrote:
> (changelog-length-parser is atached)

Well it is now anyway.

-- 
see shy jo
#!/usr/bin/perl
# Feed this program a list of debian changelogs. It will parse each, looking
# at the entries, and emit a running count of how long each individual
# changelog entry is. This was written to see if xfree86_3.3.2.3a-9 has
# the longest changelog entry ever. Useful in a linting laboratory directory,
# run as so:
#
# find -name changelog |xargs  perl changelog-length-parser |sort -n -r +2
#
# copyright Joey Hess, GPL, 1999
# (RMS will just have to live with a short copyright notice on this one.)

foreach my $f (@ARGV) {
        if ($f=~m/\.gz$/) {
                open (C,"zcat $f |");
        }
        else {
                open (C,$f);
        }

        my $counter;
        while (<C>) {
                if (/^.*?\s+\((.*?)\)\s+.*?;\s+urgency=/) {
                        $ver=$1;
                        <C>; # blank line;
                        $counter=0;
                        $inlog=1;
                }
                elsif (/^ --/) {
                        if (!$inlog) {
                                print "Parse error near ($ver) $_";
                        }
                        $counter=$counter-1;
                        $inlog=0;
                        print "$f $ver: $counter\n";
                }
                elsif ($inlog) {
                        $counter++;
                }
        }
}

Reply via email to