[Blends-commit] r2313 - blends/trunk/webtools

Debian Pure Blends Subversion Commit noreply at alioth.debian.org
Tue Aug 3 21:16:15 UTC 2010


Author: tille
Date: Tue Aug  3 21:16:12 2010
New Revision: 2313
URL: http://svn.debian.org/viewsvn/blends?rev=2313&view=rev

Log:
Fix bashism in update-all-tasks; while new_upstram has some remaining debugging code it is good enough to send e-mails to myself for the moment


Modified:
   blends/trunk/webtools/new_upstream.py
   blends/trunk/webtools/update-all-tasks

Modified: blends/trunk/webtools/new_upstream.py
URL: http://svn.debian.org/viewsvn/blends/blends/trunk/webtools/new_upstream.py?rev=2313&view=diff&r1=2313&r2=2312&p1=blends/trunk/webtools/new_upstream.py&p2=blends/trunk/webtools/new_upstream.py
==============================================================================
--- blends/trunk/webtools/new_upstream.py	(original)
+++ blends/trunk/webtools/new_upstream.py	Tue Aug  3 21:16:12 2010
@@ -1,10 +1,12 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 # Check for packages of Blend which are not up to date and send
 # E-Mail to Blend developer list
 
 from sys import argv, exit, stderr
 
 from blendstasktools import Tasks
+from blendsunicode import to_unicode
 
 if len(argv) <= 1:
 	print >>stderr, "Usage: %s <Blend name>\n       The <Blend name> needs a matching config file webconf/<Blend name>.conf"\
@@ -24,7 +26,26 @@
 		printstring = "\t%s:\n\t\tHighest version in Debian is %s\n\t\tUpstream has %s\n\t\tMaintainer is %s" % ( pkg_v_o[0] )
 		if pkg_v_o[1]:
 			printstring = printstring + "\n\t\tLast uploader was " + pkg_v_o[1]
-		print printstring
+		try:
+			print printstring
+		except UnicodeEncodeError, err:
+			try:
+				print "\t%s: Problem printing data\n\t\tHighest version in Debian is %s\n\t\tUpstream has %s\n" % \
+				    ( pkg_v_o[0][0], pkg_v_o[0][1], pkg_v_o[0][2] )
+				# maintainerfield of package gnudatalanguage which is
+				#   Gürkan Sengün <gurkan at phys.ethz.ch>
+				# breaks print for some reason I do not understand because everything should be UTF-8
+				# error is: 'ascii' codec can't encode character u'\xfc' in position 104: ordinal not in range(128)
+				# just stick to the e-mail address to do something useful ...
+				print_wo_maintainer = re.sub('^(.+Maintainer is ).+(<.+ at .+>.*)', '\\1\\2', printstring)
+				if print_wo_maintainer.startswith(printstring):
+					print "Replacement for maintainer in %s failed!" % pkg_v_o[0][0]
+				else:
+					print "\t%s:\n\t\tHighest version in Debian is %s\n\t\tUpstream has %s\n\t\tMaintainer is ..." %\
+					    ( pkg_v_o[0][0], pkg_v_o[0][1], pkg_v_o[0][2] )
+					print print_wo_maintainer[0:80]
+			except:
+				pass
 
 # Perhaps we should also send a mail to pts at qa.debian.org
 #     keyword %(pkg) %(list) = bts bts-control upload-source katie-other summary default cvs ddtp derivatives contact

Modified: blends/trunk/webtools/update-all-tasks
URL: http://svn.debian.org/viewsvn/blends/blends/trunk/webtools/update-all-tasks?rev=2313&view=diff&r1=2313&r2=2312&p1=blends/trunk/webtools/update-all-tasks&p2=blends/trunk/webtools/update-all-tasks
==============================================================================
--- blends/trunk/webtools/update-all-tasks	(original)
+++ blends/trunk/webtools/update-all-tasks	Tue Aug  3 21:16:12 2010
@@ -48,7 +48,7 @@
 
 =cut
 
-if [ "--help" == "$1" -o "-h" == "$1" ] ; then
+if [ "--help" = "$1" -o "-h" = "$1" ] ; then
 	pod2man --center "Debian Blends Documentation" update-all-tasks  | nroff -man
 	exit 1
 fi



More information about the Blends-commit mailing list