[Blends-commit] r3626 - in /blends/trunk/team_analysis_tools: count-dependencies.py med_historical_data.json

tille at users.alioth.debian.org tille at users.alioth.debian.org
Thu Oct 25 19:26:41 UTC 2012


Author: tille
Date: Thu Oct 25 19:26:40 2012
New Revision: 3626

URL: http://svn.debian.org/wsvn/blends/?sc=1&rev=3626
Log:
Sneak in historical data about previous Debian Med metapackages

Added:
    blends/trunk/team_analysis_tools/med_historical_data.json
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=3626&op=diff
==============================================================================
--- blends/trunk/team_analysis_tools/count-dependencies.py (original)
+++ blends/trunk/team_analysis_tools/count-dependencies.py Thu Oct 25 19:26:40 2012
@@ -20,7 +20,7 @@
 # BLEND='science'
 
 class taskscontent:
-    def __init__(self, version=None, date=None):
+    def __init__(self, version=None, date=None, htask=None, hrecommended=None):
 	self.version	= version
 	self.date	= date
 	self.mxdate	= DateFrom(date)
@@ -29,6 +29,10 @@
 	self.day	= self.mxdate.day
 	self.datekey    = "%04i%02i%02i" % (self.year, self.month, self.day)
 	self.recommends	= {}
+	self.nrecommended = {}
+	if htask != None and hrecommended != None:
+	    self.nrecommended[htask] = hrecommended
+	    self.recommends[htask] = []
 	self.ctrlfile	= None
 
     def add_recommends(self, package, recommends):
@@ -47,7 +51,9 @@
     def __str__(self):
 	s="Version: %s; Date: %s-%02i-%02i:" % (self.version, self.year, int(self.month), int(self.day))
 	for r in sorted(self.recommends.keys()):
-	    s += '\n  ' + r + ': ' + str(len(self.recommends[r]))
+	    if not self.nrecommended.has_key(r):
+		self.nrecommended[r] = len(self.recommends[r])
+	    s += '\n  ' + r + ': ' + str(self.nrecommended[r])
 	return s
 
 def main():
@@ -55,6 +61,39 @@
     u_dirs = listdir(root)
 
     tasks = {}
+
+    # Read some data about first med-* packages which never made it into any Vcs
+    if BLEND == 'med':
+	import json
+	fp=open('med_historical_data.json')
+	mjs=fp.read()
+	medhist = json.loads(mjs)
+	fp.close()
+	for mver in medhist:
+	    if not mver.has_key('task'):
+		continue
+	    if mver['task'] == 'bio-contrib':
+		# we are not interested in non-free dependencies
+		continue
+	    task = taskscontent(mver['version'], mver['date'], mver['task'], mver['recommends'])
+	    if tasks.has_key(task.datekey):
+		# try to match several single metapackages to what we know today as multibinary
+		mtask = tasks[task.datekey]
+		if mtask.version != task.version:
+		    mtask.version = mtask.version + '+' + task.version
+		    #print >>stderr, "Different versions at same date."
+		    #print >>stderr, "mtask = ", mtask
+		    #print >>stderr, "task = ", task
+		    #continue
+		if mtask.recommends.has_key(mver['task']):
+		    print >>stderr, "Duplicated task at same date."
+		    continue
+		mtask.recommends[mver['task']] = []
+		mtask.nrecommended[mver['task']] = mver['recommends']
+		# print mtask
+	    else:
+		tasks[task.datekey] = task
+
     for u in u_dirs:
 	if u == '.svn':
 	    continue
@@ -86,8 +125,6 @@
 	    tasks[task.datekey] = task
     	else:
     	  print >>stderr, "Unable to open control file for version %s (%s)" % (u, ctrlfile)
-    for t in sorted(tasks.keys()):
-	task = tasks[t]
 	try:
 	    ctrl = open(task.ctrlfile, 'r')
 	except:
@@ -112,6 +149,8 @@
     	        except:
     		    pkg = None
 
+    for t in sorted(tasks.keys()):
+	task = tasks[t]
         print task
 
 

Added: blends/trunk/team_analysis_tools/med_historical_data.json
URL: http://svn.debian.org/wsvn/blends/blends/trunk/team_analysis_tools/med_historical_data.json?rev=3626&op=file
==============================================================================
--- blends/trunk/team_analysis_tools/med_historical_data.json (added)
+++ blends/trunk/team_analysis_tools/med_historical_data.json Thu Oct 25 19:26:40 2012
@@ -1,0 +1,37 @@
+[
+ {"task": "bio", "version": "0.1-1", "date": "2002-02-06", "recommends": "4"},
+ {"task": "bio", "version": "0.1-2", "date": "2002-02-08", "recommends": "6"},
+ {"task": "bio", "version": "0.2-1", "date": "2002-04-14", "recommends": "7"},
+ {"task": "bio", "version": "0.3-1", "date": "2002-04-19", "recommends": "8"},
+ {"task": "bio", "version": "0.4-1", "date": "2002-05-18", "recommends": "8"},
+ {"task": "bio", "version": "0.4-2", "date": "2002-05-28", "recommends": "9"},
+ {"comment": "leave out bio 0.4-3 which has no change in number and was released at same day as 0.4-2"},
+ {"task": "bio", "version": "0.5-1", "date": "2002-06-24", "recommends": "9"},
+ {"task": "bio", "version": "0.5-2", "date": "2003-01-05", "recommends": "12"},
+ {"comment": "seems bio 0.5-3 was never released - at least there is no changelog entry"},
+ {"task": "bio", "version": "0.5-4", "date": "2003-04-04", "recommends": "15"},
+ {"task": "bio", "version": "0.5-5", "date": "2004-01-14", "recommends": "17"},
+ {"task": "bio", "version": "0.5-6", "date": "2004-02-13", "recommends": "19"},
+ {"task": "bio-contrib", "version": "0.1-1", "date": "2002-02-06", "recommends": "6"},
+ {"task": "dent", "version": "0.1-1", "date": "2002-02-06", "recommends": "1"},
+ {"comment": "the world has seen the following versions of dent: 0.1-2, 0.2-1, 0.3-1, 0.4-1, 0.5-1 and 0.5-2 - but none of these added additional dependencies"},
+ {"task": "imaging", "version": "0.4-4", "date": "2003-10-05", "recommends": "7"},
+ {"task": "imaging", "version": "0.4-3", "date": "2003-04-14", "recommends": "8"},
+ {"task": "imaging", "version": "0.4-2", "date": "2002-07-24", "recommends": "5"},
+ {"task": "imaging", "version": "0.4-1", "date": "2002-06-26", "recommends": "5"},
+ {"task": "imaging", "version": "0.3-1", "date": "2002-05-28", "recommends": "5"},
+ {"task": "imaging", "version": "0.2-1", "date": "2002-05-19", "recommends": "4"},
+ {"task": "imaging", "version": "0.1-1", "date": "2002-04-11", "recommends": "4"},
+ {"task": "imaging-dev", "version": "0.3-4", "date": "2003-10-05", "recommends": "4"},
+ {"task": "imaging-dev", "version": "0.3-3", "date": "2003-04-23", "recommends": "5"},
+ {"task": "imaging-dev", "version": "0.3-2", "date": "2003-04-14", "recommends": "5"},
+ {"task": "imaging-dev", "version": "0.3-1", "date": "2002-06-26", "recommends": "3"},
+ {"task": "imaging-dev", "version": "0.2-1", "date": "2002-05-19", "recommends": "2"},
+ {"task": "imaging-dev", "version": "0.1-1", "date": "2002-04-11", "recommends": "2"},
+ {"task": "tools", "version": "0.3-3", "date": "2003-06-29", "recommends": "1"},
+ {"task": "tools", "version": "0.3-2", "date": "2003-04-14", "recommends": "2"},
+ {"task": "tools", "version": "0.3-1", "date": "2002-06-25", "recommends": "1"},
+ {"task": "tools", "version": "0.2-1", "date": "2002-05-19", "recommends": "1"},
+ {"task": "tools", "version": "0.1-1", "date": "2002-02-06", "recommends": "1"},
+ {"task": "cms", "version": "0.1-1", "date": "2004-01-06", "recommends": "1"}
+]




More information about the Blends-commit mailing list