X-Git-Url: https://git.donarmstrong.com/?p=bugscan.git;a=blobdiff_plain;f=scanlib.pm;h=7cd2e63386c39cb3fa2abebef87f3391e0439c08;hp=123abb9a7945345d27b8b01b548df5a27c41f62b;hb=edf5233a4e26818318ca7900c9c775e450e45f35;hpb=5b1d396f8f09c314859583a8f8b96876e043f2cd diff --git a/scanlib.pm b/scanlib.pm index 123abb9..7cd2e63 100644 --- a/scanlib.pm +++ b/scanlib.pm @@ -10,6 +10,9 @@ # %section - map from packagename to section in the FTP-site # %packagelist - map from packagename to bugreports +use warnings; +use strict; + use lib qw(/org/bugs.debian.org/perl); use LWP::UserAgent; use Debbugs::MIME qw(decode_rfc1522 encode_rfc1522); @@ -17,9 +20,11 @@ use Debbugs::Packages; use Debbugs::Versions; use Debbugs::Status; use Fcntl qw(O_RDONLY); -use strict; -use warnings; -require bugcfg; + +use File::Basename; +use lib dirname(__FILE__); +use bugcfg; + package scanlib; our (%maintainer,%section,%packagelist,%debbugssection,%bugs); @@ -46,14 +51,10 @@ sub readmaintainers() { } -sub readsources() { - my $root; # Root of archive we are scanning - my $archive; # Name of archive we are scanning - my $sect; # Name of current section +sub readsources { + my ($root,$archive) = @_; - $root=shift; - $archive=shift; - for $sect (@bugcfg::sections) { + for my $sect (@bugcfg::sections) { open(P, "zcat $root/$sect/source/Sources.gz|") or die open "open: $sect sourcelist: $!\n"; while (

) { @@ -96,12 +97,9 @@ sub readpackages { } } -sub readdebbugssources() { - my $file; - my $archive; +sub readdebbugssources { + my ($file,$archive) = @_; - $file=shift; - $archive=shift; open(P, $file) or die "open: $file: $!\n"; while (

) { @@ -183,8 +181,8 @@ sub scanspooldir { next if $skip==1; my %disttags = (); - for (qw(unstable stable testing unstable)) { - $disttags{$_} = grep(/^$bug_cfg::debian_releases->{$_}$/, @tags); + for my $release (qw(oldstable stable testing unstable)) { + $disttags{$release} = grep(/^$bugcfg::debian_releases->{$release}$/, @tags); } $disttags{'experimental'} = grep(/^experimental$/, @tags); @@ -234,7 +232,7 @@ sub scanspooldir { } for my $keyword (qw(pending patch help moreinfo unreproducible security upstream), - map {$_.$bug_cfg::debian_releases->{testing}.'-ignore'} keys %{$bug_cfg::debian_releases}) { + map {$bugcfg::debian_releases->{$_}.'-ignore'} keys %{$bugcfg::debian_releases}) { $bi->{$keyword} = grep(/^$keyword$/, @tags); } @@ -326,13 +324,13 @@ sub wwwname() { sub check_worry { my ($bi) = @_; - return ($bi->{'testing'} && !$bi->{$bug_cfg::debian_releases->{testing}.'-ignore'}); + return ($bi->{'testing'} && !$bi->{$bugcfg::debian_releases->{testing}.'-ignore'}); } sub check_worry_stable { my ($bi) = @_; - return ($bi->{'stable'} && !$bi->{$bug_cfg::debian_releases->{stable}.'-ignore'}); + return ($bi->{'stable'} && !$bi->{$bugcfg::debian_releases->{stable}.'-ignore'}); } sub check_worry_unstable { @@ -352,7 +350,7 @@ sub get_taginfo { $taginfo .= $bi->{'unreproducible'} ? "R" : " "; $taginfo .= $bi->{'security'} ? "S" : " "; $taginfo .= $bi->{'upstream'} ? "U" : " "; - $taginfo .= ($bi->{$bug_cfg::debian_releases->{stable}.'-ignore'} || $bi->{$bug_cfg::debian_releases->{testing}.'-ignore'}) ? "I" : " "; + $taginfo .= ($bi->{$bugcfg::debian_releases->{stable}.'-ignore'} || $bi->{$bugcfg::debian_releases->{testing}.'-ignore'}) ? "I" : " "; return $taginfo; }