]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Stop useless overspecification of variables in Debbugs::Packages
authorDon Armstrong <don@volo>
Sat, 3 Feb 2007 08:07:39 +0000 (00:07 -0800)
committerDon Armstrong <don@volo>
Sat, 3 Feb 2007 08:07:39 +0000 (00:07 -0800)
 * Comment better some of the complex maps and slices
 * Fix notfound writing in makestatus
 * Import binarytosource from Debbugs::Packages

Debbugs/Packages.pm
Debbugs/Status.pm

index 1274193631e3b6855fdfd573b00f6b959df68483..5284e2c58f2aeecd459f32f75d96fd4a11f4efd2 100644 (file)
@@ -122,10 +122,11 @@ sub binarytosource {
 
     # 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;
@@ -178,7 +179,7 @@ sub sourcetobinary {
 
     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;
index 6badbf3b9e2cc26022adfdd2699414618b65aa90..3a7df96bc5878607810e781c0bbf34f8390004c0 100644 (file)
@@ -31,7 +31,7 @@ use Params::Validate qw(validate_with :types);
 use Debbugs::Common qw(:util :lock :quit);
 use Debbugs::Config qw(:config);
 use Debbugs::MIME qw(decode_rfc1522 encode_rfc1522);
-use Debbugs::Packages qw(makesourceversions getversions);
+use Debbugs::Packages qw(makesourceversions getversions binarytosource);
 use Debbugs::Versions;
 use Debbugs::Versions::Dpkg;
 use POSIX qw(ceil);
@@ -189,6 +189,8 @@ sub read_bug{
         $data{$field} = [split ' ', $data{$field}];
     }
     for my $field (qw(found fixed)) {
+        # create the found/fixed hashes which indicate when a
+        # particular version was marked found or marked fixed.
         @{$data{$field}}{@{$data{"${field}_versions"}}} =
              (('') x (@{$data{"${field}_date"}} - @{$data{"${field}_versions"}}),
               @{$data{"${field}_date"}});
@@ -257,7 +259,7 @@ sub makestatus {
     }
 
     for my $field (qw(found_versions fixed_versions found_date fixed_date)) {
-        $newdata{$field} = [split ' ', $newdata{$field}||''];
+        $newdata{$field} = join ' ', @{$newdata{$field}||[]};
     }
 
     if ($version < 3) {