]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Packages.pm
croak in subroutines
[debbugs.git] / Debbugs / Packages.pm
index c7fd47c18b6f5dde189a563fe8e61ad2e8955a6e..6980315f06afef7b160d6ea47af695c1dc5bc2eb 100644 (file)
@@ -39,7 +39,7 @@ use Storable qw(dclone);
 use Params::Validate qw(validate_with :types);
 use Debbugs::Common qw(make_list globify_scalar sort_versions);
 
-use List::Util qw(min max);
+use List::AllUtils qw(min max);
 
 use IO::File;
 
@@ -72,13 +72,14 @@ our $_pkgcomponent;
 our $_srcpkg;
 sub getpkgsrc {
     return $_pkgsrc if $_pkgsrc;
-    return {} unless defined $Debbugs::Packages::gPackageSource;
+    return {} unless defined $config{package_source} and
+       length $config{package_source};
     my %pkgsrc;
     my %pkgcomponent;
     my %srcpkg;
 
     my $fh = IO::File->new($config{package_source},'r')
-       or die("Unable to open $config{package_source} for reading: $!");
+       or croak("Unable to open $config{package_source} for reading: $!");
     while(<$fh>) {
        next unless m/^(\S+)\s+(\S+)\s+(\S.*\S)\s*$/;
        my ($bin,$cmp,$src)=($1,$2,$3);