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

Raphael Geissert atomo64-guest at alioth.debian.org
Mon Apr 20 04:34:43 UTC 2009


Author: atomo64-guest
Date: 2009-04-20 04:34:43 +0000 (Mon, 20 Apr 2009)
New Revision: 1433

Modified:
   ddpo-by-mail/Makefile
   ddpo-by-mail/reminder-mail.rb
Log:
Know about and report lintian errors and warnings. Not even errors are, atm, considered 'serious'


Modified: ddpo-by-mail/Makefile
===================================================================
--- ddpo-by-mail/Makefile	2009-04-19 23:56:12 UTC (rev 1432)
+++ ddpo-by-mail/Makefile	2009-04-20 04:34:43 UTC (rev 1433)
@@ -1,6 +1,6 @@
 #!/usr/bin/make -f
 
-UPDATE_TARGETS:=bts2ldap_fullindex ddpo_packages ddpo_maintainers testing-status.raw dehs.txt ood_excuses.txt pts_subscriptions.txt wnpp_rm
+UPDATE_TARGETS:=bts2ldap_fullindex ddpo_packages ddpo_maintainers testing-status.raw dehs.txt ood_excuses.txt pts_subscriptions.txt wnpp_rm lintian-list.txt
 WGET_OPTIONS:=-nv -N
 WGET:=wget $(WGET_OPTIONS)
 DATA_DIR:=data
@@ -33,6 +33,9 @@
 wnpp_rm:
 	$(WGET) http://qa.debian.org/data/bts/wnpp_rm
 
+lintian-list.txt:
+	$(WGET) http://qa.debian.org/data/$@
+
 clean: clean-update
 	# remove broken symlinks:
 	find -L $(DATA_DIR) -type l -exec unlink '{}' ';'

Modified: ddpo-by-mail/reminder-mail.rb
===================================================================
--- ddpo-by-mail/reminder-mail.rb	2009-04-19 23:56:12 UTC (rev 1432)
+++ ddpo-by-mail/reminder-mail.rb	2009-04-20 04:34:43 UTC (rev 1433)
@@ -59,9 +59,14 @@
 
 # Get maintainer for each package
 haslist = {}
+pkg_maintainer = {}
 maintainers_pkg.keys.each do |email|
   maintainers_pkg[email].each do |pkg|
-    pkg = pkg.chop if pkg =~ /#/
+    if pkg =~ /#/
+      pkg = pkg.chop
+    else
+      pkg_maintainer[pkg] = email
+    end
     haslist[pkg] = true if email =~ /@list.*\.debian\.org$/
   end
 end
@@ -83,6 +88,13 @@
   end
 end
 
+# get lintian report
+lintian = {}
+IO::read('data/lintian-list.txt').each_line do |l|
+  pkg, errors, warnings = l.chomp.split(' ')
+  lintian[pkg] = [errors.to_i, warnings.to_i]
+end
+
 bugs, bugtitles = parse_bugs
 testingissues = testing_issues(dipkgs)
 dehs = get_dehs
@@ -118,6 +130,10 @@
     pissues << [ :dehs, dehs[pkg][0], dehs[pkg][1] ]
     serious[pkg] ||= dehs[pkg][2]
   end
+  if lintian[pkg]
+    pissues << [ :lintian, lintian[pkg][0], lintian[pkg][1] ]
+    #serious[pkg] ||= lintian[pkg][0]
+  end
   unless pissues.empty?
     issues[pkg] = pissues 
     serious[pkg] = pserious
@@ -190,6 +206,7 @@
     ptext = "=== #{pkg}:#{comaint}\n"
     incptext = false
     testingpl = 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]) }
@@ -234,6 +251,19 @@
           end
         end
         dehstext += "  #{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 "
+        if iss[1] > 0
+          ptext += "#{iss[1]} error(s)"
+        end
+        if iss[2]
+          ptext += " and" if iss[1] > 0
+          ptext += " #{iss[2]} warning(s)"
+        end
+        ptext += ", you should consider fixing them.\n"
+        ptext += " See http://lintian.debian.org/maintainer/#{maintainer}.html##{pkg}\n"
       else
         raise "Unknown issue #{iss[0]}!"
       end




More information about the Collab-qa-commits mailing list