[Collab-qa-commits] r2332 - udd/udd

Andreas Tille tille at alioth.debian.org
Wed May 16 13:31:51 UTC 2012


Author: tille
Date: 2012-05-16 13:31:51 +0000 (Wed, 16 May 2012)
New Revision: 2332

Modified:
   udd/udd/blends_prospective_gatherer.py
Log:
More verbose information about the team in logfile


Modified: udd/udd/blends_prospective_gatherer.py
===================================================================
--- udd/udd/blends_prospective_gatherer.py	2012-05-16 12:08:12 UTC (rev 2331)
+++ udd/udd/blends_prospective_gatherer.py	2012-05-16 13:31:51 UTC (rev 2332)
@@ -124,21 +124,42 @@
             bibrefs.append(ref)
           continue
 
+        sprosp = {}
+    	# Read Vcs fields
+        vcsfile = upath+'/'+source+'.vcs'
+    	try:
+    	  vcs = open(vcsfile,'r')
+    	except:
+    	  self.log.warning("Unable to open Vcs file for source '%s' (%s)" % (source, vcsfile))
+    	for line in vcs.readlines():
+    	  (field,value) = line.split(': ')
+    	  field = field.strip()
+    	  value = value.strip()
+    	  if field == 'Blend':
+    	    sprosp['blend'] = value
+    	  elif field == 'Vcs-Browser':
+    	    sprosp['vcs_browser'] = value
+    	  else:
+            matchvcs = vcs_type_re.match(field)
+            if matchvcs:
+              sprosp['vcs_type'] = matchvcs.groups()[0]
+    	      sprosp['vcs_url'] = value
+    	vcs.close()
+
         # Read output of dpkg-parsechangelog
         p = Popen("LC_ALL=C dpkg-parsechangelog -l"+upath+'/'+source+'.changelog', shell=True, bufsize=4096,
           stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
         errstring = p.stderr.read()
         if errstring != '':
-          self.log.warning("Error parsing changelog of '%s'\n %s:" % (source, errstring))
-        sprosp = {}
+          self.log.warning("Error parsing changelog of '%s' of %s\n %s:" % (source, sprosp['blend'], errstring))
         for stanza in deb822.Sources.iter_paragraphs(p.stdout):
           if source != stanza['source']:
-            print >>stderr, "Something is wrong with changelog data of package '%s'.  Changelog says source = '%s'." % (source, stanza['source'])
+            print >>stderr, "Something is wrong with changelog data of package '%s' of %s.  Changelog says source = '%s'." % (source, sprosp['blend'], stanza['source'])
           for prop in ('source', 'distribution'):
             if stanza.has_key(prop):
               sprosp[prop] = stanza[prop]
             else:
-             self.log.warning("Missing property %s in changelog of '%s'" % (prop, source))
+             self.log.warning("Missing property %s in changelog of '%s' of %s" % (prop, source, sprosp['blend']))
           sprosp['chlog_version']    = stanza['version']
           if stanza.has_key('maintainer'):
             sprosp['changed_by']       = stanza['maintainer']
@@ -149,12 +170,12 @@
             sprosp['changed_by']       = ''
             sprosp['changed_by_name']  = ''
             sprosp['changed_by_email'] = ''
-            self.log.warning("Can not obtain maintainer e-mail from changelog of '%s'" % (source))
+            self.log.warning("Can not obtain maintainer e-mail from changelog of '%s' of %s" % (source, sprosp['blend']))
           if stanza.has_key('date'):
             sprosp['chlog_date']       = stanza['date']
           else:
             sprosp['chlog_date']       = ''
-            self.log.warning("Can not obtain changed data from changelog of '%s'" % (source))
+            self.log.warning("Can not obtain changed data from changelog of '%s' of %s" % (source, sprosp['blend']))
           sprosp['closes'] = []
           if stanza.has_key('closes'):
             for bug in stanza['closes'].split(' '):
@@ -166,7 +187,7 @@
 #          if match: # try to make sure we are really dealing with ITPs
           for iwnpp in sprosp['closes']:
             if iwnpp == 12345: # that seems to be a fake ITP
-              self.log.debug("Fake WNPP no. 12345 in changelog of '%s'" % (source))
+              self.log.debug("Fake WNPP no. 12345 in changelog of '%s' of %s" % (source, sprosp['blend']))
               continue
             elif iwnpp > 0:
               sprosp['wnpp'] = iwnpp
@@ -178,45 +199,24 @@
                   sprosp['wnpp_type'] = itpmatch.groups()[0]
                   sprosp['wnpp_desc'] = itpmatch.groups()[2]
                   if source != itpmatch.groups()[1]:
-                    self.log.info("Source name of %s differs from name in %s bug: package name = %s, short description = %s" % (source, itpmatch.groups()[0], itpmatch.groups()[1], itpmatch.groups()[2]))
+                    self.log.info("Source name of '%s' of %s differs from name in %s bug: package name = %s, short description = %s" % (source, sprosp['blend'], itpmatch.groups()[0], itpmatch.groups()[1], itpmatch.groups()[2]))
                 else:
-                  self.log.warning("Cannot parse ITP bug %i for package %s: `%s`" % (iwnpp, source, wnppbug['title']))
+                  self.log.warning("Cannot parse ITP bug %i for package '%s' of %s: `%s`" % (iwnpp, source, sprosp['blend'], wnppbug['title']))
               else:
-                self.log.debug("ITP bug %i for package %s is not open any more or can otherwise not be found" % (iwnpp, source))
+                self.log.debug("ITP bug %i for package '%s' of %s is not open any more or can otherwise not be found" % (iwnpp, source, sprosp['blend']))
                 continue # Try other bug number if exists
               break
           match = find_itp_re.search(changes)
           if not match and sprosp['wnpp_type'] == '' and len(sprosp['closes']) > 0 and sprosp['wnpp'] > 0:
             sprosp['wnpp'] = 0
-            self.log.warning("Bug %s closed in changelog of package %s does not seem to be an ITP" % (str(sprosp['closes']), source))
+            self.log.warning("Bug %s closed in changelog of package '%s' of %s does not seem to be an ITP" % (str(sprosp['closes']), source, sprosp['blend']))
     	
-    	# Read Vcs fields
-        vcsfile = upath+'/'+source+'.vcs'
-    	try:
-    	  vcs = open(vcsfile,'r')
-    	except:
-    	  self.log.warning("Unable to open Vcs file for source '%s' (%s)" % (source, vcsfile))
-    	for line in vcs.readlines():
-    	  (field,value) = line.split(': ')
-    	  field = field.strip()
-    	  value = value.strip()
-    	  if field == 'Blend':
-    	    sprosp['blend'] = value
-    	  elif field == 'Vcs-Browser':
-    	    sprosp['vcs_browser'] = value
-    	  else:
-            matchvcs = vcs_type_re.match(field)
-            if matchvcs:
-              sprosp['vcs_type'] = matchvcs.groups()[0]
-    	      sprosp['vcs_url'] = value
-    	vcs.close()
-
     	# Read Copyright file if specifying Format in the first line
         cprfile = upath+'/'+source+'.copyright'
     	try:
     	  cpr = open(cprfile,'r')
     	except:
-    	  self.log.warning("Unable to open Copyright file for source '%s' of %s (%s)" % (source, sprosp['blend'], cprfile))
+    	  self.log.debug("Unable to open Copyright file for source '%s' of %s (%s)" % (source, sprosp['blend'], cprfile))
     	linenr = 0
     	found_files = False
     	sprosp['license'] = ''




More information about the Collab-qa-commits mailing list