[Collab-qa-commits] r484 - tools/bugs2packagelist

lucas at alioth.debian.org lucas at alioth.debian.org
Mon Oct 8 08:48:27 UTC 2007


Author: lucas
Date: 2007-10-08 08:48:27 +0000 (Mon, 08 Oct 2007)
New Revision: 484

Modified:
   tools/bugs2packagelist/fetchbugs.rb
Log:
script improved

Modified: tools/bugs2packagelist/fetchbugs.rb
===================================================================
--- tools/bugs2packagelist/fetchbugs.rb	2007-10-08 08:48:00 UTC (rev 483)
+++ tools/bugs2packagelist/fetchbugs.rb	2007-10-08 08:48:27 UTC (rev 484)
@@ -1,5 +1,6 @@
 #!/usr/bin/ruby -w
-
+# ruby ../../tools/bugs2packagelist/fetchbugs.rb user usertag < list > newlist 2>log
+# ruby ../../tools/bugs2packagelist/fetchbugs.rb debian-qa at lists.debian.org qa-ftbfs-20071007 < failed.2007-10-07.txt > failed.2007-10-07.txt.2 2>log
 require 'soap/rpc/driver'
 bts = SOAP::RPC::Driver::new('http://bugs.debian.org/cgi-bin/soap.cgi', '/Debbugs/SOAP')
 bts.add_method('get_status', 'bugs')
@@ -10,7 +11,7 @@
 
 bugs = bts.get_usertag(ARGV[0], ARGV[1])
 pkgs = Hash::new([])
-bts.get_status(bugs[ARGV[1]]).each_pair do |k, v|
+bts.get_status(bugs[ARGV[1]].sort.uniq).each_pair do |k, v|
   pkgs[v.package] = [] if pkgs[v.package] == [] # force reinit
   pkgs[v.package] << [k, v.subject]
 end
@@ -20,7 +21,7 @@
   matches = rest.scan(/((#\d+|NNN).*)/)
   m = matches[0]
   if matches[0].nil?
-    STDERR.puts "NO BUG FOUND: #{l}"
+    STDERR.puts "NOTHING ON LINE: #{l}"
   else
     m = m[0]
     m.gsub!(/\s+RECHECK.*/,'')
@@ -28,11 +29,13 @@
       if pkgs[p].length == 1
         txt = "##{pkgs[p][0][0]}: #{pkgs[p][0][1]}"
         rest.gsub!(m, txt)
-      else
+      elsif pkgs[p].length > 1
         STDERR.puts "SEVERAL BUGS: #{l}"
         pkgs[p].each do |b|
           STDERR.puts " - ##{b[0]}: #{b[1]}"
         end
+      else
+       STDERR.puts "NO BUG FOUND: #{l}"
       end
     else # it's a bug number.
       numb = m.gsub(/^#(\d+).*/,'\1').to_i




More information about the Collab-qa-commits mailing list