From: Don Armstrong Date: Sun, 9 Dec 2007 00:45:55 +0000 (-0800) Subject: * Add support for return_archs in get_versions X-Git-Tag: release/2.6.0~510^2~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e19faafbde7621928750bc461ea82c4a17cf22fc;p=debbugs.git * Add support for return_archs in get_versions --- diff --git a/Debbugs/Packages.pm b/Debbugs/Packages.pm index 7103fc10..39e5ed82 100644 --- a/Debbugs/Packages.pm +++ b/Debbugs/Packages.pm @@ -259,6 +259,9 @@ not passed. [Used for finding the versions of binary packages only.] Defaults to 0, which does not discard the source architecture. (This may change in the future, so if you care, please code accordingly.) +=item return_archs -- returns a version=>[archs] hash indicating which +architectures are at which versions. + =back =cut @@ -285,6 +288,9 @@ sub get_versions{ no_source_arch => {type => BOOLEAN, default => 0, }, + return_archs => {type => BOOLEAN, + default => 0, + }, }, ); my $versions; @@ -328,14 +334,17 @@ sub get_versions{ $versions{$f_ver} = max($versions{$f_ver}||0,$version->{$dist}{$arch}{$ver}); } else { - $versions{$f_ver} = 1; + push @{$versions{$f_ver}},$arch; } } } } } if ($param{time}) { - return %versions + return %versions; + } + elsif ($param{return_archs}) { + return %versions; } return keys %versions; }