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

Raphael Geissert atomo64-guest at alioth.debian.org
Fri Apr 24 20:50:21 UTC 2009


Author: atomo64-guest
Date: 2009-04-24 20:50:21 +0000 (Fri, 24 Apr 2009)
New Revision: 1438

Modified:
   ddpo-by-mail/reminder-mail.rb
Log:
Fix the position of the release.d.o link


Modified: ddpo-by-mail/reminder-mail.rb
===================================================================
--- ddpo-by-mail/reminder-mail.rb	2009-04-23 14:51:57 UTC (rev 1437)
+++ ddpo-by-mail/reminder-mail.rb	2009-04-24 20:50:21 UTC (rev 1438)
@@ -140,6 +140,15 @@
   end
 end
 
+# prevent typos by using constants, so that it breask :)
+T_INCLUDE = "include"
+T_HEADER = "header"
+T_BUGS = "bugs"
+T_BUILDS = "builds"
+T_TESTING = "testing"
+T_LINTIAN = "lintian"
+T_DEHS = "dehs"
+
 puts "Preparing mail for each maintainer..."
 # prepare mail for each maintainer
 (maintainers_pkg.keys + subscribers.keys).sort.uniq.each do |email|
@@ -190,7 +199,9 @@
     EOF
   end
 
-  dehstext = ''
+  text = {}
+  text[T_DEHS] = ""
+
   # iterate on all packages
   (maintained.keys + mpkgs.keys).sort.uniq.each do |pkg|
     next if issues[pkg].nil?
@@ -207,76 +218,79 @@
       only_uploader = false if serious[pkg]
     end
     mserious = mserious || serious[pkg]
-    ptext = "=== #{pkg}:#{comaint}\n"
-    incptext = false
-    testingpl = false
+
+    text[pkg] = {}
+    text[pkg][T_HEADER] = "=== #{pkg}:#{comaint}\n"
+    text[pkg][T_INCLUDE] = false
     maintainer = pkg_maintainer[pkg]
     issues[pkg].each do |iss|
       if iss[0] == :bugs
         bugs = iss[1].reject { |b| EXC_EMAILS_BUGS[email].include?(b[0]) }
 	next if bugs.length == 0
-        incptext = true
-        ptext += "= #{bugs.length} bug(s) that should be fixed for the next Debian release:\n"
+        text[pkg][T_INCLUDE] = true
+        text[pkg][T_BUGS] = "= #{bugs.length} bug(s) that should be fixed for the next Debian release:\n"
         bugs.each do |b|
-          ptext += "- ##{b[0]} <http://bugs.debian.org/#{b[0]}>\n"
-          ptext += "  #{bugtitles[b[0]]}\n"
+          text[pkg][T_BUGS] += "- ##{b[0]} <http://bugs.debian.org/#{b[0]}>\n"
+          text[pkg][T_BUGS] += "  #{bugtitles[b[0]]}\n"
           if b[2] == "RC"
 	    # add nothing
           elsif b[2] == "PROP"
 	    # add nothing
           else
-            ptext += "  Part of release goal: #{b[2]}\n"
+            text[pkg][T_BUGS] += "  Part of release goal: #{b[2]}\n"
           end
         end
       elsif iss[0] == :builds
-        incptext = true
-        ptext += "= Missing build(s) on #{iss[1]}\n"
-        ptext += "  This might need manual action from your side.\n"
-        ptext += "  See http://buildd.debian.org/pkg.cgi?pkg=#{pkg}\n"
+        text[pkg][T_INCLUDE] = true
+        text[pkg][T_BUILDS] = "= Missing build(s) on #{iss[1]}\n"
+        text[pkg][T_BUILDS] += "  This might need manual action from your side.\n"
+        text[pkg][T_BUILDS] += "  See http://buildd.debian.org/pkg.cgi?pkg=#{pkg}\n"
       elsif iss[0] == :not_testing
-        incptext = true
-        ptext += "= Not in testing for #{iss[2]} days.\n"
+        text[pkg][T_INCLUDE] = true
+        text[pkg][T_TESTING] = "= Not in testing for #{iss[2]} days.\n"
         if CLOSE_TO_FREEZE or FROZEN
-          ptext += "  If things don't change, it won't be part of #{TESTING}!\n"
+          text[pkg][T_TESTING] += "  If things don't change, it won't be part of #{TESTING}!\n"
         end
-        testingpl = true
       elsif iss[0] == :no_migration
-        incptext = true
-        ptext += "= No migration to testing for #{iss[2]} days.\n"
-        testingpl = true
+        text[pkg][T_INCLUDE] = true
+        text[pkg][T_TESTING] = "= No migration to testing for #{iss[2]} days.\n"
       elsif iss[0] == :dehs
-        if dehstext == ''
-          dehstext = "=== Packages with a new upstream version according to DEHS:\n"
+        if text[T_DEHS] == ''
+          text[T_DEHS] = "=== Packages with a new upstream version according to DEHS:\n"
           if FROZEN
-            dehstext += <<-EOF
+            text[T_DEHS] += <<-EOF
 (note that #{TESTING} is frozen: do not upload those new upstream
 versions to unstable unless you are sure it is the right thing to do!)
             EOF
           end
         end
-        dehstext += "  #{pkg}  #{iss[2]}  (Debian: #{iss[1]})\n"
+        text[T_DEHS] += "  #{pkg}  #{iss[2]}  (Debian: #{iss[1]})\n"
       elsif iss[0] == :lintian
         next if (iss[1] < 1 and iss[2] < 1)
-        incptext = true
-        ptext += "= Lintian reports"
+        text[pkg][T_INCLUDE] = true
+        text[pkg][T_LINTIAN] = "= Lintian reports"
         if iss[1] > 0
-          ptext += " #{iss[1]} error(s)"
+          text[pkg][T_LINTIAN] += " #{iss[1]} error(s)"
         end
         if iss[2]
-          ptext += " and" if iss[1] > 0
-          ptext += " #{iss[2]} warning(s)"
+          text[pkg][T_LINTIAN] += " and" if iss[1] > 0
+          text[pkg][T_LINTIAN] += " #{iss[2]} warning(s)"
         end
-        ptext += ", you should consider fixing them.\n"
-        ptext += " See http://lintian.debian.org/maintainer/#{maintainer}.html##{pkg}\n"
+        text[pkg][T_LINTIAN] += ", you should consider fixing them.\n"
+        text[pkg][T_LINTIAN] += " See http://lintian.debian.org/maintainer/#{maintainer}.html##{pkg}\n"
       else
         raise "Unknown issue #{iss[0]}!"
       end
     end
-    if testingpl
-      ptext += "  See <http://release.debian.org/migration/testing.pl?package=#{pkg}>\n"
+    if text[pkg][T_TESTING]
+      text[pkg][T_TESTING] += "  See <http://release.debian.org/migration/testing.pl?package=#{pkg}>\n"
     end
-    if incptext
-      gtext += ptext
+    if text[pkg][T_INCLUDE]
+      gtext += text[pkg][T_HEADER]
+      gtext += text[pkg][T_BUGS] if text[pkg][T_BUGS]
+      gtext += text[pkg][T_BUILDS] if text[pkg][T_BUILDS]
+      gtext += text[pkg][T_TESTING] if text[pkg][T_TESTING]
+      gtext += text[pkg][T_LINTIAN] if text[pkg][T_LINTIAN]
       gtext += "\n"
     end
   end
@@ -289,8 +303,8 @@
     next
   end
   # add dehs text
-  if dehstext != ''
-    gtext += dehstext + "\n"
+  if text[T_DEHS] != ''
+    gtext += text[T_DEHS] + "\n"
   end
   gtext += <<-EOF
 ------------ interesting stuff probably ends here ------------




More information about the Collab-qa-commits mailing list