From edbb0e4cc0bc8b35ce327e83011d8a199798dbca Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 5 Mar 2009 20:19:31 -0800 Subject: [PATCH] * Fix archs typo * Properly handle arch:all packages * Don't bother to dereference $source in srcbinary --- Debbugs/Packages.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Debbugs/Packages.pm b/Debbugs/Packages.pm index 307e1f9..5db565d 100644 --- a/Debbugs/Packages.pm +++ b/Debbugs/Packages.pm @@ -167,6 +167,9 @@ sub binarytosource { elsif (exists $binary{$binver}) { if (defined $binarch) { my $src = $binary{$binver}{$binarch}; + if (not defined $src and exists $binary{$binver}{all}) { + $src = $binary{$binver}{all}; + } return () unless defined $src; # not on this arch # Copy the data to avoid tiedness problems. return dclone($src); @@ -219,9 +222,8 @@ sub sourcetobinary { # avoid autovivification my $source = $_sourcetobinary{$srcname}; return () unless defined $source; - my %source = %{$source}; - if (exists $source{$srcver}) { - my $bin = $source{$srcver}; + if (exists $source->{$srcver}) { + my $bin = $source->{$srcver}; return () unless defined $bin; return @$bin; } @@ -340,8 +342,8 @@ sub get_versions{ for my $arch (exists $param{arch}? make_list($param{arch}): (grep {not $param{no_source_arch} or - $_ ne 'source' - } keys %{$version->{$dist}})) { + $_ ne 'source' + } keys %{$version->{$dist}})) { next unless defined $version->{$dist}{$arch}; for my $ver (ref $version->{$dist}{$arch} ? keys %{$version->{$dist}{$arch}} : @@ -444,9 +446,8 @@ sub make_source_versions { my ($warnings) = globify_scalar(exists $param{warnings}?$param{warnings}:undef); my ($debug) = globify_scalar(exists $param{debug} ?$param{debug} :undef); - my @packages = grep {defined $_ and length $_ } make_list($param{package}); - my @archs = grep {defined $_ } make_list ($param{archs}); + my @archs = grep {defined $_ } make_list ($param{arch}); if (not @archs) { push @archs, ''; } -- 2.39.2