]> git.donarmstrong.com Git - bugscan.git/blobdiff - scanlib.pm
ignore undefined values when we filter
[bugscan.git] / scanlib.pm
index 3dca704000de24c6dfc17caa78410b7cde07edaf..96aee35a063b6768be7f589e713a4cff6bf4ef89 100644 (file)
@@ -1,5 +1,5 @@
 #! /usr/bin/perl
-# vim: ts=4 sw=4 nowrap
+# vim: ts=8 sw=8 nowrap
 #
 # General functions for scanning the BTS-database.
 # Based on bugscan, written by Richard Braakman <dark@debian.org>,
@@ -83,6 +83,7 @@ sub readpackages() {
                                next unless m/^Package:\s/;     # We're only interested in the packagenames
                                s/^Package:\s*//;                       # Strip the fieldname
                                $section{$_} = "$archive/$sect";
+                               print "$root/$sect/binary-$arch/Packages.gz\n" if ($_ eq 'xtla');
                        }
                        close(P);
                }
@@ -141,6 +142,8 @@ sub scanspooldir() {
        my $skip;               # Flow control
        my $walk;               # index variable
        my $taginfo;    # Tag info
+                                       
+       my @archs_with_source = ( @bugcfg::architectures, 'source' );
 
        chdir($dir) or die "chdir $dir: $!\n";
 
@@ -174,14 +177,15 @@ sub scanspooldir() {
                next if $skip==1;
        
                my %disttags = ();      
-               $disttags{'oldstable'}    = grep(/^woody$/, @tags);
-               $disttags{'stable'}       = grep(/^sarge$/, @tags);
-               $disttags{'testing'}      = grep(/^etch$/, @tags);
+               $disttags{'oldstable'}    = grep(/^etch$/, @tags);
+               $disttags{'stable'}       = grep(/^lenny$/, @tags);
+               $disttags{'testing'}      = grep(/^squeeze$/, @tags);
                $disttags{'unstable'}     = grep(/^sid$/, @tags);
                $disttags{'experimental'} = grep(/^experimental$/, @tags);
                        
-               # default according to dondelelcaro 2006-11-11
+               # default according to vorlon 2007-06-17
                if (!$disttags{'oldstable'} && !$disttags{'stable'} && !$disttags{'testing'} && !$disttags{'unstable'} && !$disttags{'experimental'}) {
+                       $disttags{'stable'} = 1;
                        $disttags{'testing'} = 1;
                        $disttags{'unstable'} = 1;
                        $disttags{'experimental'} = 1;
@@ -208,7 +212,7 @@ sub scanspooldir() {
                                        bug => $f, 
                                        status => $bug, 
                                        dist => $dist, 
-                                       arch => \@bugcfg::architectures
+                                       arch => \@archs_with_source
                                );
 
                                # ignore bugs that are absent/fixed in this distribution, include everything
@@ -224,8 +228,8 @@ sub scanspooldir() {
                        next if !$affects_any;
                }
 
-               for my $keyword qw(pending patch help moreinfo unreproducible security upstream sarge-ignore etch-ignore) {
-                       $bi->{$keyword} = ($bug->{'keywords'} =~ /\b$keyword\b/) ? 1 : 0;
+               for my $keyword qw(pending patch help moreinfo unreproducible security upstream etch-ignore lenny-ignore squeeze-ignore) {
+                       $bi->{$keyword} = grep(/^$keyword$/, @tags);
                }
 
                if (length($bug->{'mergedwith'})) {
@@ -234,7 +238,7 @@ sub scanspooldir() {
                }
 
                for my $package (split /[,\s]+/, $bug->{'package'}) {
-                       $_= $package; y/A-Z/a-z/; $_= $` if m/[^-+._a-z0-9]/;
+                       $_= $package; y/A-Z/a-z/; $_= $` if m/[^-+._:a-z0-9]/;
                        push @{$packagelist{$_}}, $f;
                }
 
@@ -316,13 +320,19 @@ sub wwwname() {
 sub check_worry {
        my ($bi) = @_;
 
-       return ($bi->{'testing'} && !$bi->{'etch-ignore'});
+       return ($bi->{'testing'} && !$bi->{'squeeze-ignore'});
 }
 
 sub check_worry_stable {
        my ($bi) = @_;
 
-       return ($bi->{'stable'} && !$bi->{'sarge-ignore'});
+       return ($bi->{'stable'} && !$bi->{'lenny-ignore'});
+}
+
+sub check_worry_unstable {
+       my ($bi) = @_;
+
+       return ($bi->{'unstable'});
 }
 
 sub get_taginfo {
@@ -336,7 +346,7 @@ sub get_taginfo {
        $taginfo .= $bi->{'unreproducible'} ? "R" : " ";
        $taginfo .= $bi->{'security'}       ? "S" : " ";
        $taginfo .= $bi->{'upstream'}       ? "U" : " ";
-       $taginfo .= ($bi->{'sarge-ignore'} || $bi->{'etch-ignore'}) ? "I" : " ";
+       $taginfo .= ($bi->{'lenny-ignore'} || $bi->{'squeeze-ignore'}) ? "I" : " ";
 
        return $taginfo;
 }