[Blends-commit] r3605 - /blends/trunk/team_analysis_tools/count-dependencies.py

tille at users.alioth.debian.org tille at users.alioth.debian.org
Thu Oct 25 06:37:20 UTC 2012


Author: tille
Date: Thu Oct 25 06:37:20 2012
New Revision: 3605

URL: http://svn.debian.org/wsvn/blends/?sc=1&rev=3605
Log:
Sort versions to enable comparable results (sorting metapackages will follow)

Modified:
    blends/trunk/team_analysis_tools/count-dependencies.py

Modified: blends/trunk/team_analysis_tools/count-dependencies.py
URL: http://svn.debian.org/wsvn/blends/blends/trunk/team_analysis_tools/count-dependencies.py?rev=3605&op=diff
==============================================================================
--- blends/trunk/team_analysis_tools/count-dependencies.py (original)
+++ blends/trunk/team_analysis_tools/count-dependencies.py Thu Oct 25 06:37:20 2012
@@ -6,7 +6,7 @@
 
 from sys import stderr, exit
 from os import listdir
-from os.path import exists
+from os.path import isfile
 from fnmatch import fnmatch
 import re
 from subprocess import Popen, PIPE
@@ -20,13 +20,15 @@
 
 class taskscontent:
     def __init__(self, version=None, date=None):
-	self.version = version
-	self.date    = date
-	self.mxdate  = DateFrom(date)
-	self.year    = self.mxdate.year
-	self.month   = self.mxdate.month
-	self.day     = self.mxdate.day
-	self.recommends = {}
+	self.version	= version
+	self.date	= date
+	self.mxdate	= DateFrom(date)
+	self.year	= self.mxdate.year
+	self.month	= self.mxdate.month
+	self.day	= self.mxdate.day
+	self.datekey    = "%04i%02i%02i" % (self.year, self.month, self.day)
+	self.recommends	= {}
+	self.ctrlfile	= None
 
     def add_recommends(self, package, recommends):
         p = re.sub(BLEND+'-', '', package.encode('utf-8'))
@@ -51,7 +53,7 @@
     root = '../../../projects/'+BLEND+'/tags' 
     u_dirs = listdir(root)
 
-    versions = {}
+    tasks = {}
     for u in u_dirs:
 	if u == '.svn':
 	    continue
@@ -72,11 +74,17 @@
 
     	# Try to read debian/control
     	ctrlfile = debiandir + 'control'
-    	try:
-    	  ctrl = open(ctrlfile,'r')
-    	except:
+	if isfile(ctrlfile):
+	    task.ctrlfile = ctrlfile
+	    tasks[task.datekey] = task
+    	else:
     	  print >>stderr, "Unable to open control file for version %s (%s)" % (u, ctrlfile)
-    	  continue
+    for t in sorted(tasks.keys()):
+	task = tasks[t]
+	try:
+	    ctrl = open(task.ctrlfile, 'r')
+	except:
+	    print >>stderr, "Unable to open control file for version %s (%s) ... even if file exists" % (task.version, task.ctrlfile)
     	if ctrl:
 	  ictrl = deb822.Deb822.iter_paragraphs(ctrl)
 	  src = ictrl.next()




More information about the Blends-commit mailing list