From: Don Armstrong Date: Sat, 3 Feb 2007 08:07:39 +0000 (-0800) Subject: * Stop useless overspecification of variables in Debbugs::Packages X-Git-Tag: release/2.6.0~585^2^2~28 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=55e8450e4898f34169524fe80984f72461205df8;p=debbugs.git * Stop useless overspecification of variables in Debbugs::Packages * Comment better some of the complex maps and slices * Fix notfound writing in makestatus * Import binarytosource from Debbugs::Packages --- diff --git a/Debbugs/Packages.pm b/Debbugs/Packages.pm index 1274193..5284e2c 100644 --- a/Debbugs/Packages.pm +++ b/Debbugs/Packages.pm @@ -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; diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm index 6badbf3..3a7df96 100644 --- a/Debbugs/Status.pm +++ b/Debbugs/Status.pm @@ -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) {