]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Packages.pm
- Handle src/binary packages with the same name (but different src
[debbugs.git] / Debbugs / Packages.pm
index b34e1b5643ba8e8cbb5342be48c7c60ab9a1efb1..7103fc10daf9fefd1afaa7e2918f57267ae7300d 100644 (file)
@@ -254,6 +254,11 @@ matching this version was uploaded
 
 =item source -- returns source/version instead of just versions
 
+=item no_source_arch -- discards the source architecture when arch is
+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.)
+
 =back
 
 =cut
@@ -277,6 +282,9 @@ sub get_versions{
                                           source  => {type    => BOOLEAN,
                                                       default => 0,
                                                      },
+                                          no_source_arch => {type => BOOLEAN,
+                                                             default => 0,
+                                                            },
                                          },
                               );
      my $versions;
@@ -303,7 +311,9 @@ sub get_versions{
          for my $dist (make_list($param{dist})) {
               for my $arch (exists $param{arch}?
                             make_list($param{arch}):
-                            (keys %{$version->{$dist}})) {
+                            (grep {not $param{no_source_arch} or
+                                        $_ ne 'source'
+                              } keys %{$version->{$dist}})) {
                    next unless defined $version->{$dist}{$arch};
                    for my $ver (ref $version->{$dist}{$arch} ?
                                 keys %{$version->{$dist}{$arch}} :