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

tille at users.alioth.debian.org tille at users.alioth.debian.org
Sat Jun 23 13:51:39 UTC 2012


Author: tille
Date: Sat Jun 23 13:51:38 2012
New Revision: 3441

URL: http://svn.debian.org/wsvn/blends/?sc=1&rev=3441
Log:
Better handling of older (=pre 1.0) metapackages

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=3441&op=diff
==============================================================================
--- blends/trunk/team_analysis_tools/count-dependencies.py (original)
+++ blends/trunk/team_analysis_tools/count-dependencies.py Sat Jun 23 13:51:38 2012
@@ -15,6 +15,9 @@
 
 debug=0
 
+# FIXME: Blend name should be parameter - currently only used for Debian Med
+BLEND='med'
+
 class taskscontent:
     def __init__(self, version=None, date=None):
 	self.version = version
@@ -27,9 +30,16 @@
 
     def add_recommends(self, package, recommends):
         p = package.encode('utf-8')
-	r = recommends.encode('utf-8').split(',')
-	self.recommends[p] = r
-    
+	
+	self.recommends[p] = []
+	for r in recommends.encode('utf-8').split(','):
+	    r = r.strip()
+	    # since we also need to investigate "Depends" for older metapackages we also
+	    # need to exclude the extra control packages
+	    if r == BLEND+'-common' or r == BLEND+'-config' or r == BLEND+'-tasks':
+		continue
+	    self.recommends[p].append(r)
+
     def __str__(self):
 	s="Version: %s; Date: %s-%02i-%02i:" % (self.version, self.year, int(self.month), int(self.day))
 	for r in self.recommends.keys():
@@ -37,7 +47,7 @@
 	return s
 
 def main():
-    root = '../../../projects/med/tags' # FIXME: Blend name should be parameter - currently only used for Debian Med
+    root = '../../../projects/'+BLEND+'/tags' 
     u_dirs = listdir(root)
 
     versions = {}
@@ -73,13 +83,18 @@
 	  while pkg:
             if pkg.has_key('package'):
                 package = pkg['package']
-    	        if pkg.has_key('recommends'):
-    	            recommends = pkg['recommends']
-    	            task.add_recommends(package,recommends)
-    	    try:
-    		pkg = ictrl.next()
-    	    except:
-    		pkg = None
+                if package != BLEND+'-common':
+                    if pkg.has_key('recommends'):
+    	                recommends = pkg['recommends']
+    	                task.add_recommends(package,recommends)
+    	            # in previous package versions we use Depends rather then Recommends
+    	            if pkg.has_key('depends'):
+    	                depends = pkg['depends']
+    	                task.add_recommends(package,depends)
+    	        try:
+    		    pkg = ictrl.next()
+    	        except:
+    		    pkg = None
 
         print task
 




More information about the Blends-commit mailing list