[Collab-qa-commits] r775 - bapase
lucas at alioth.debian.org
lucas at alioth.debian.org
Thu Apr 10 07:24:38 UTC 2008
Author: lucas
Date: 2008-04-10 07:24:38 +0000 (Thu, 10 Apr 2008)
New Revision: 775
Added:
bapase/bugs_rm_pkgs.rb
Log:
preliminary work on bugs from removed packages
Added: bapase/bugs_rm_pkgs.rb
===================================================================
--- bapase/bugs_rm_pkgs.rb (rev 0)
+++ bapase/bugs_rm_pkgs.rb 2008-04-10 07:24:38 UTC (rev 775)
@@ -0,0 +1,87 @@
+#!/usr/bin/ruby -w
+
+# lists bugs that:
+# - are not marked as done
+# - don't affect testing, unstable or experimental
+# - don't belong to a package in testing, unstable or experimental
+
+# For each bug, check:
+# - if the bug could be reassigned to another package (maybe discuss with the new package's maintainers). for example, bugs in linux-image-2.6.22-3-686 might have to be reassigned to another kernel package
+# - find the removal in removals*txt, find the removal bug, read the removal bug
+# - close all bugs with a Version: tag, using:
+# + <last version in Debian>+rm as version string
+# + maybe using a special address in From:
+
+# TODO:
+# write a script to mass-reassign bugs using a template
+# write a script to mass-close bugs using a template
+
+# see merkel:/org/bugs.debian.org/etc/pseudo-packages.description
+PSEUDO_PKGS = ['base', 'cdrom', 'spam', 'press', 'kernel', 'project', 'general', 'listarchives', 'nm.debian.org', 'qa.debian.org', 'ftp.debian.org', 'www.debian.org', 'bugs.debian.org', 'lists.debian.org', 'wnpp', 'cdimage.debian.org', 'tech-ctte', 'mirrors', 'security.debian.org', 'installation-reports', 'upgrade-reports', 'release-notes']
+
+STDERR.puts "#{Time::now} Reading LDAP dump"
+bugid = nil
+bugsrcpkg = nil
+bugpkg = nil
+bugtitle = nil
+bugstate = nil
+bugaffect = []
+
+ibugs = []
+IO::read('bts2ldap-fullindex').each_line do |l|
+ l.chomp!
+ key, val = l.split(' ', 2)
+ if key == 'dn:' and bugid != nil
+ # fin du bug en cours
+ if not (bugaffect.include?('unstable') or bugaffect.include?('testing') or bugaffect.include?('experimental')) and bugstate != 'done' and not PSEUDO_PKGS.include?(bugpkg)
+ ibugs << [bugid, bugpkg, bugsrcpkg, bugtitle]
+ end
+
+ bugid = nil
+ bugsrcpkg = nil
+ bugpkg = nil
+ bugtitle = nil
+ bugstate = nil
+ bugaffect = []
+ bugaffect = []
+
+ elsif key == 'debbugsID:'
+ bugid = val
+ elsif key == 'debbugsSourcePackage:'
+ bugsrcpkg = val
+ elsif key == 'debbugsPackage:'
+ bugpkg = val
+ elsif key == 'debbugsState:'
+ bugstate = val
+ elsif key == 'debbugsTitle:'
+ bugtitle = val
+ elsif key == 'debbugsAffected:'
+ bugaffect << val
+ end
+end
+
+STDERR.puts "#{Time::now} End reading LDAP dump"
+STDERR.puts "#{Time::now} Reading *Sources"
+f = []
+[ 'testing-*-Sources', 'unstable-*-Sources', 'experimental-*-Sources'].each do |m|
+ f += Dir::glob(m)
+end
+srcs = {}
+bins = {}
+f.each do |s|
+ IO::read(s).each_line do |l|
+ if l =~ /^Package: /
+ srcs[l.split(' ')[1]] = true
+ elsif l =~ /^Binary: /
+ l.split(' ',2)[1].split(/, /).each do |b|
+ bins[b] = true
+ end
+ end
+ end
+end
+STDERR.puts "#{Time::now} End reading *Sources"
+ibugs.each do |l|
+ # could be made stricter at some point
+ next if srcs[l[2]] or bins[l[1]] or srcs[l[1]] or bins[l[2]]
+ puts l.join(' ')
+end
More information about the Collab-qa-commits
mailing list