[Collab-qa-commits] r325 - ddpo-by-mail

lucas at alioth.debian.org lucas at alioth.debian.org
Tue Jul 10 10:31:39 UTC 2007


Author: lucas
Date: 2007-07-10 10:31:39 +0000 (Tue, 10 Jul 2007)
New Revision: 325

Added:
   ddpo-by-mail/ddpo-config.rb
Modified:
   ddpo-by-mail/reminder-mail.rb
Log:
ddpo-by-mail update

implemented various suggestions
moved config to another file


Added: ddpo-by-mail/ddpo-config.rb
===================================================================
--- ddpo-by-mail/ddpo-config.rb	                        (rev 0)
+++ ddpo-by-mail/ddpo-config.rb	2007-07-10 10:31:39 UTC (rev 325)
@@ -0,0 +1,32 @@
+# Globally excluded packages
+EXC_PKGS = [
+'hurd', # only exist on hurd-i386, which isn't a testing arch, so that's OK
+'gnumach',
+'mig'
+]
+
+# Maintainers who unsubscribed, or dummy maintainers
+EXC_EMAILS = [
+  'marillat at debian.org',
+  'mpalmer at debian.org'
+]
+
+EXC_BUGS = [
+  '368560', #debian-x at lists.debian.org
+  '368559',
+  '211765',
+  '368564',
+  '383465'
+]
+
+EXC_EMAILS_PKGS = Hash::new { [] }
+EXC_EMAILS_PKGS['debian-gcc at lists.debian.org'] = ['gcc-2.95', 'gcc-snapshot' ]
+
+SENDMAIL = true
+WRITEDDLIST = true
+WRITEPCLIST = true
+BUG_AGE = 30
+LAST_IN_TESTING = 100
+LAST_IN_SYNC = 100
+# etch released on 2007-04-08. So
+# (Date::today - Date::parse('2007-04-08')).to_i

Modified: ddpo-by-mail/reminder-mail.rb
===================================================================
--- ddpo-by-mail/reminder-mail.rb	2007-07-10 10:12:02 UTC (rev 324)
+++ ddpo-by-mail/reminder-mail.rb	2007-07-10 10:31:39 UTC (rev 325)
@@ -2,19 +2,8 @@
 
 $:.unshift File.join(File.dirname(__FILE__), '..', 'testing-status')
 require 'pkgtestingstatus'
+require 'ddpo-config'
 
-SENDMAIL = true
-WRITEDDLIST = true
-WRITEPCLIST = true
-BUG_AGE = 30
-LAST_IN_TESTING = 180
-LAST_IN_SYNC = 360
-PKGS_EXCLUDE = [
-'hurd', # only exist on hurd-i386, which isn't a testing arch, so that's OK
-'gnumach',
-'mig'
-]
-
 def update_data
   system("rm -f buglist ddpo_packages ddpo_maintainers popcon_by_inst")
   system("wget -q -O buglist 'http://bts.turmzimmer.net/details.php?bydist=sid&sortby=packages&ignnew=on&new=#{BUG_AGE}&refresh=1800'")
@@ -39,6 +28,7 @@
 bugs = Hash::new { [] }
 nb = 0
 bug = []
+bugtitle = {}
 pkgs.each do |p|
   curpkg = nil
   pbug = []
@@ -48,8 +38,18 @@
     elsif l =~ /^<span class="comment">/
       # do nothing
     else 
-      pbug << l.match(/ name="([^"]*)">/)[1]
-      # do nothing
+      b = l.match(/ name="([^"]*)">/)[1]
+      if EXC_BUGS.include?(b)
+        puts "Skipping #{b}, it is excluded."
+        next
+      end
+      # skip if fixed in new
+      next if l =~ /(<a href="http:\/\/ftp-master.debian.org\/new.html">fixed in NEW<\/a>)/
+      pbug << b
+      # cleanup
+      l = l.gsub(/ \(<a href="http:\/\/bjorn.haxx.se\/debian\/testing.pl\?package=.*">Removal requested by \w+<\/a>\)/,'')
+      # get the bug title
+      bugtitle[b] = l.gsub(/^[^\]]*\] ([^<]*)(<\/span>)?$/, '\1')
     end
     bugs[curpkg] = pbug unless curpkg.nil?
     bug += pbug
@@ -108,7 +108,7 @@
 
 # compute issues for each package
 issues = Hash::new { [] }
-(bugs.keys + pts.keys - PKGS_EXCLUDE).sort.uniq.each do |p|
+(bugs.keys + pts.keys - EXC_PKGS).sort.uniq.each do |p|
   if rms.include?(p)
     puts "Skipping #{p}, it is RM."
     next
@@ -155,6 +155,8 @@
     end
     mpkgs.keys.sort.each do |p|
       next if issues[p].empty?
+      # skip if excluded
+      next if EXC_EMAILS_PKGS[email].include?(p)
       #next if not mpkgs[p] # skip if only uploader
       if not mpkgs[p]
         comaint = ' (you co-maintain this package)'
@@ -162,18 +164,19 @@
         comaint = ''
         only_uploader = false
       end
-      ptext = " #{p}:#{comaint}\n"
+      ptext = "=== #{p}:#{comaint}\n"
       issues[p].each do |iss|
         if iss[0] == :rc_bugs
-          ptext += "  This package has #{iss[1].length} RC bug(s) more than #{BUG_AGE} days old:\n"
+          ptext += "= This package has #{iss[1].length} RC bug(s) more than #{BUG_AGE} days old:\n"
           iss[1].each do |b|
-            ptext += "   - ##{b}\n"
+            ptext += "- ##{b} <http://bugs.debian.org/#{b}>\n"
+            ptext += "  #{bugtitle[b]}\n"
           end
         elsif iss[0] == :not_testing
-          ptext += "  This package has not been in testing for more than #{iss[1]} days.\n"
+          ptext += "= This package has not been in testing for more than #{iss[1]} days.\n"
         elsif iss[0] == :no_migration
-          ptext += "  This package has not been able to migrate from unstable\n"
-          ptext += "    to testing for more than #{iss[1]} days.\n"
+          ptext += "= This package has not been able to migrate from unstable\n"
+          ptext += "  to testing for more than #{iss[1]} days.\n"
         end
       end
       gtext += ptext
@@ -199,7 +202,9 @@
 You will no longer receive information about that package in those
 mails. So if that package is the only one with problems, you won't
 receive anything.
-Both commands are manually processed, but you will receive
+- ignore <bug> <email>
+You will no longer receive information about this bug.
+All commands are manually processed, but you will receive
 confirmation. The commands are just here so that we know precisely
 what you want.
 
@@ -216,9 +221,13 @@
         puts "Skipping mail for #{email}, only co-maint pkgs have issues"
         next
       end
-File::open("mail_#{email}.txt", 'w') do |f|
-  f.puts gtext
-end
+      if EXC_EMAILS.include?(email)
+        puts "Skipping mail for #{email}, IS EXCLUDED"
+        next
+      end
+      File::open("mail_#{email}.txt", 'w') do |f|
+        f.puts gtext
+      end
     end
   end
 end




More information about the Collab-qa-commits mailing list