Author: adam-guest
Date: 2008-02-26 07:14:33 +0000 (Tue, 26 Feb 2008)
New Revision: 1057

Modified:
   trunk/Devscripts/Debbugs.pm
   trunk/debian/changelog
Log:
* Debbugs.pm: Add status(), versions() and versions_with_arch()


Modified: trunk/Devscripts/Debbugs.pm
===================================================================
--- trunk/Devscripts/Debbugs.pm 2008-02-26 07:11:58 UTC (rev 1056)
+++ trunk/Devscripts/Debbugs.pm 2008-02-26 07:14:33 UTC (rev 1057)
@@ -156,6 +156,64 @@
     return $bugs;
 }
 
+sub versions {
+    die "Couldn't run versions: $soap_broken\n" unless have_soap();
+
+    my @args = @_;
+    my %valid_keys = (package => 'package',
+                     pkg     => 'package',
+                     src => 'source',
+                     source => 'source',
+                     time => 'time',
+                     binary => 'no_source_arch',
+                     notsource => 'no_source_arch',
+                     archs => 'return_archs',
+                     displayarch => 'return_archs',
+                      );
+
+    my %search_parameters;
+    my @archs = ();
+    my @dists = ();
+
+    for my $arg (@args) {
+        my ($key,$value) = split /:/, $arg, 2;
+       $value ||= "1";
+       if ($key =~ /^arch(itecture)?$/) {
+           push @archs, $value;
+       } elsif ($key =~ /^dist(ribution)?$/) {
+           push @dists, $value;
+       } elsif (exists $valid_keys{$key}) {
+           $search_parameters{$valid_keys{$key}} = $value;
+       }
+    }
+
+    $search_parameters{arch} = [EMAIL PROTECTED] if @archs;
+    $search_parameters{dist} = [EMAIL PROTECTED] if @dists;
+
+    my $soap = SOAP::Lite->uri($soapurl)->proxy($soapproxyurl);
+
+    my $versions = $soap->get_versions(%search_parameters)->result();
+
+    if (not defined $versions) {
+       die "Error while retrieivng package versions from SOAP server: $@";
+    }
+
+    return $versions;
+}
+
+sub versions_with_arch {
+    die "Couldn't run versions_with_arch: $soap_broken\n" unless have_soap();
+    my @args = @_;
+
+    my $versions = versions(@args, 'displayarch:1');
+
+    if (not defined $versions) {
+       die "Error while retrieivng package versions from SOAP server: $@";
+    }
+
+    return $versions;
+}
+
 1;
 
 __END__

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-02-26 07:11:58 UTC (rev 1056)
+++ trunk/debian/changelog      2008-02-26 07:14:33 UTC (rev 1057)
@@ -3,10 +3,10 @@
   [ Adam D. Barratt ]
   * checkbashisms:
     + Fix a false positive in the $(( test (Closes: #465364)
-    + Add detection for <<<, $(OS|MACH)TYPE, $HOST(TYPE|NAME), $EUID, 
+    + Add detection for <<<, $(OS|MACH)TYPE, $HOST(TYPE|NAME), $EUID,
       $DIRSTACK, $SECONDS and /dev/(tcp|udp) (Closes: #465386)
     + Enhance heredoc detection to not trigger on <<<
-  * Debbugs.pm: Add status()
+  * Debbugs.pm: Add status(), versions() and versions_with_arch()
   * tagpending:
     + Rewrite in perl using Debbugs.pm
     + Optionally (and by default) include the changelog header line and



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to