]> git.donarmstrong.com Git - bugscan.git/blobdiff - scanlib.pm
use open_compresed file and give more output when scanlib fails
[bugscan.git] / scanlib.pm
index bb9d170e5d47b8357c5c93739b21afd664b8be5d..5ce31a8226f9a11e74f6626bb3d30ac5943b5a5e 100644 (file)
@@ -19,7 +19,7 @@ use Debbugs::MIME qw(decode_rfc1522 encode_rfc1522);
 use Debbugs::Packages;
 use Debbugs::Versions;
 use Debbugs::Status;
-use IO::Uncompress::AnyUncompress;
+use Debbugs::Common qw(open_compressed_file);
 use Fcntl qw(O_RDONLY);
 
 use File::Basename;
@@ -53,8 +53,11 @@ sub readmaintainers() {
 
 sub glob_compressed_fh {
     my ($fn) = @_;
-    $fn = (grep { -f $_ } glob $fn)[0];
-    my $fh = IO::Uncopmress::AnyUncompress->new($fn) or
+    my @fn = grep { -f $_ } glob $fn;
+    if (not @fn) {
+       die "No files exist which match glob '$fn'";
+    }
+    my $fh = open_compressed_file($fn[0]) or
         die "Unable to open $fn for reading: $!";
     return $fh;
 }
@@ -312,14 +315,14 @@ sub htmlsanit {
     return $in;
 }
 
-sub wwwnumber() {
+sub wwwnumber {
        my $number = shift;             # Number of bug to html-ize
 
        "<A HREF=\"http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&amp;bug=" .
                urlsanit($number) . '">' . htmlsanit($number) . '</A>';
 }
 
-sub wwwname() {
+sub wwwname {
        my $name = shift;                       # Name of package
 
        "<A HREF=\"http://bugs.debian.org/cgi-bin/pkgreport.cgi?archive=no&amp;pkg=" .
@@ -327,15 +330,20 @@ sub wwwname() {
 }
 
 sub check_worry {
-       my ($bi) = @_;
+       my ($bi,$dist) = @_;
+    $dist = 'testing' if not defined $dist;
 
-       return ($bi->{'testing'} && !$bi->{$bugcfg::debian_releases->{testing}.'-ignore'});
+       return ($bi->{$dist} && !$bi->{$bugcfg::debian_releases->{$dist}.'-ignore'});
 }
 
+sub check_worry_testing {
+    return check_worry($_[0],'testing');
+}
 sub check_worry_stable {
-       my ($bi) = @_;
-
-       return ($bi->{'stable'} && !$bi->{$bugcfg::debian_releases->{stable}.'-ignore'});
+    return check_worry($_[0],'stable');
+}
+sub check_worry_oldstable {
+    return check_worry($_[0],'oldstable');
 }
 
 sub check_worry_unstable {