]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Packages.pm
merge changes from source
[debbugs.git] / Debbugs / Packages.pm
index 1274193631e3b6855fdfd573b00f6b959df68483..a5c2cacba2e5696dbff1798b1e6fb43f1375f4e0 100644 (file)
@@ -52,9 +52,9 @@ source package names.
 
 =cut
 
-my $_pkgsrc;
-my $_pkgcomponent;
-my $_srcpkg;
+our $_pkgsrc;
+our $_pkgcomponent;
+our $_srcpkg;
 sub getpkgsrc {
     return $_pkgsrc if $_pkgsrc;
     return {} unless defined $Debbugs::Packages::gPackageSource;
@@ -116,16 +116,17 @@ with any duplicates removed.
 
 =cut
 
-my %_binarytosource;
+our %_binarytosource;
 sub binarytosource {
     my ($binname, $binver, $binarch) = @_;
 
     # TODO: This gets hit a lot, especially from buggyversion() - probably
     # need an extra cache for speed here.
+    return () unless defined $gBinarySourceMap;
 
     if (tied %_binarytosource or
            tie %_binarytosource, 'MLDBM',
-               $Debbugs::Packages::gBinarySourceMap, O_RDONLY) {
+               $gBinarySourceMap, O_RDONLY) {
        # avoid autovivification
        my $binary = $_binarytosource{$binname};
        return () unless defined $binary;
@@ -172,13 +173,13 @@ returned, without the architecture.
 
 =cut
 
-my %_sourcetobinary;
+our %_sourcetobinary;
 sub sourcetobinary {
     my ($srcname, $srcver) = @_;
 
     if (tied %_sourcetobinary or
            tie %_sourcetobinary, 'MLDBM',
-               $Debbugs::Packages::gSourceBinaryMap, O_RDONLY) {
+               $gSourceBinaryMap, O_RDONLY) {
        # avoid autovivification
        my $source = $_sourcetobinary{$srcname};
        return () unless defined $source;
@@ -203,7 +204,7 @@ architecture
 
 =cut
 
-my %_versions;
+our %_versions;
 sub getversions {
     my ($pkg, $dist, $arch) = @_;
     return () unless defined $gVersionIndex;
@@ -218,7 +219,7 @@ sub getversions {
     my %version = %{$version};
 
     if (defined $arch and exists $version{$dist}{$arch}) {
-        my $ver = $version{$pkg}{$dist}{$arch};
+        my $ver = $version{$dist}{$arch};
         return $ver if defined $ver;
         return ();
     } else {
@@ -250,7 +251,7 @@ version numbers differ from binary version numbers.
 
 =cut
 
-my %_sourceversioncache = ();
+our %_sourceversioncache = ();
 sub makesourceversions {
     my $pkg = shift;
     my $arch = shift;