[Collab-qa-commits] r912 - bapase/rm_pkgs

lucas at alioth.debian.org lucas at alioth.debian.org
Sat Jul 12 09:45:00 UTC 2008


Author: lucas
Date: 2008-07-12 09:44:59 +0000 (Sat, 12 Jul 2008)
New Revision: 912

Added:
   bapase/rm_pkgs/mass-reassign
Log:
added mass-reassign script

Added: bapase/rm_pkgs/mass-reassign
===================================================================
--- bapase/rm_pkgs/mass-reassign	                        (rev 0)
+++ bapase/rm_pkgs/mass-reassign	2008-07-12 09:44:59 UTC (rev 912)
@@ -0,0 +1,74 @@
+#!/usr/bin/ruby -w
+
+if ARGV.length != 2
+  puts "Usage: mass-reassign sourcepackage dstpackage"
+  puts "please set the RMFROM and RMSIG env variables (try with $. config-generic)"
+  exit(1)
+end
+
+require 'pp'
+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')
+bts.add_method('get_bugs', 'params')
+bts.add_method('get_bug_log', 'params')
+bts.add_method('get_usertag', 'email', 'tag')
+bts.add_method('newest_bugs', 'num')
+
+PKG=ARGV[0]
+NPKG=ARGV[1]
+SENDMAIL=true
+
+puts "------bugs for #{PKG}-----"
+bugs = bts.get_bugs(['src', PKG])
+status = bts.get_status(bugs)
+bugs = []
+status.each_pair do |k, v|
+  next if v.done != ''
+  puts "#{k} #{v.package} #{v.severity} #{v.pending} #{v.subject}"
+  bugs << k
+end
+puts "-- press enter to continue --"
+STDIN.readline
+tmp=`mktemp /tmp/email.#{PKG}.XXXXXX`.chomp
+f = File::new(tmp, "w")
+f.puts <<EOF
+From: #{ENV['RMFROM']}
+To: TMPL_TO at bugs.debian.org, control at bugs.debian.org, #{NPKG}@packages.debian.org
+Subject: Reassigning bugs from #{PKG} to #{NPKG}
+
+TMPL_REASSIGN
+
+The #{PKG} package has been removed from Debian testing, unstable and
+experimental. I am reassigning its bugs to the #{NPKG} package. Please
+have a look at them, and close them if they don't apply to
+#{NPKG} anymore.
+
+Don't hesitate to reply to this mail if you have any question.
+#{ENV['RMSIG']}
+EOF
+f.close
+ed=ENV['EDITOR']
+if ed.nil?
+  ed='sensible-editor'
+end
+system("#{ed} #{tmp}")
+s = IO::read(tmp)
+puts "-- press enter to send the mails --"
+STDIN.readline
+to = bugs.join('@bugs.debian.org, ')
+reass = ""
+bugs.each do |b|
+  reass += "reassign #{b} #{NPKG}\n"
+end
+reass += "thanks"
+puts "Sending mail"
+if SENDMAIL
+  f = IO::popen("/usr/sbin/sendmail -t", "w")
+else
+  f = File::new("email.#{PKG}.txt", "w")
+end
+mail = s.gsub('TMPL_TO', to)
+mail = mail.gsub('TMPL_REASSIGN', reass)
+f.puts mail
+f.close


Property changes on: bapase/rm_pkgs/mass-reassign
___________________________________________________________________
Name: svn:executable
   + *




More information about the Collab-qa-commits mailing list