X-Git-Url: https://git.donarmstrong.com/?p=bugscan.git;a=blobdiff_plain;f=scanlib.pm;h=9171f8490b6289019edc9fd69a1b87c1a6f17680;hp=19fda963bf83e8ccd5a0e184d9cca54211893ec9;hb=ae54d20caf7246c5d844357a33c302f623cba394;hpb=89ba932822098c735cafa97ead959a574d954ead diff --git a/scanlib.pm b/scanlib.pm index 19fda96..9171f84 100644 --- a/scanlib.pm +++ b/scanlib.pm @@ -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::Uncompress::AnyUncompress->new($fn) or + my @fn = grep { -f $_ } glob $fn; + if (not @fn) { + die "No files exist which match glob '$fn'"; + } + my $fh = Debbugs::Common::open_compressed_file($fn[0]) or die "Unable to open $fn for reading: $!"; return $fh; } @@ -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 {