]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Add support for return_archs in get_versions
authorDon Armstrong <don@donarmstrong.com>
Sun, 9 Dec 2007 00:45:55 +0000 (16:45 -0800)
committerDon Armstrong <don@donarmstrong.com>
Sun, 9 Dec 2007 00:45:55 +0000 (16:45 -0800)
Debbugs/Packages.pm

index 7103fc10daf9fefd1afaa7e2918f57267ae7300d..39e5ed82ae246d5b2a274de3d3703571ed6c5b7b 100644 (file)
@@ -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.)
 
 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
 =back
 
 =cut
@@ -285,6 +288,9 @@ sub get_versions{
                                           no_source_arch => {type => BOOLEAN,
                                                              default => 0,
                                                             },
                                           no_source_arch => {type => BOOLEAN,
                                                              default => 0,
                                                             },
+                                          return_archs => {type => BOOLEAN,
+                                                           default => 0,
+                                                          },
                                          },
                               );
      my $versions;
                                          },
                               );
      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} = max($versions{$f_ver}||0,$version->{$dist}{$arch}{$ver});
                         }
                         else {
-                             $versions{$f_ver} = 1;
+                             push @{$versions{$f_ver}},$arch;
                         }
                    }
               }
          }
      }
      if ($param{time}) {
                         }
                    }
               }
          }
      }
      if ($param{time}) {
-         return %versions
+         return %versions;
+     }
+     elsif ($param{return_archs}) {
+         return %versions;
      }
      return keys %versions;
 }
      }
      return keys %versions;
 }