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

Debian Pure Blends Subversion Commit noreply at alioth.debian.org
Thu Feb 5 20:11:15 UTC 2009


Author: tille
Date: Wed Feb  4 08:58:22 2009
New Revision: 1366
URL: http://svn.debian.org/viewsvn/blends?rev=1366&view=rev

Log:
Start parsing all dists (stable, testing, unstable, experimental) instead of only unstable.  The information is not yet used but the old behaviour of the script is implemented


Modified:
   blends/trunk/webtools/blendstasktools.py

Modified: blends/trunk/webtools/blendstasktools.py
URL: http://svn.debian.org/viewsvn/blends/blends/trunk/webtools/blendstasktools.py?rev=1366&view=diff&r1=1366&r2=1365&p1=blends/trunk/webtools/blendstasktools.py&p2=blends/trunk/webtools/blendstasktools.py
==============================================================================
--- blends/trunk/webtools/blendstasktools.py	(original)
+++ blends/trunk/webtools/blendstasktools.py	Wed Feb  4 08:58:22 2009
@@ -27,8 +27,8 @@
 from debian_bundle import deb822
 
 BASEURL  = 'http://ftp.debian.org/'
-# SVNHOST  = 'svn+ssh://svn.debian.org'
-SVNHOST  = 'svn://svn.debian.org'
+SVNHOST  = 'svn+ssh://svn.debian.org'
+# SVNHOST  = 'svn://svn.debian.org'
 KEYSTOIGNORE = ( 'Architecture', 'Comment', 'Leaf', 'NeedConfig', 'Note', 'Section',
                  'Needconfig', 'DontAvoid',
                  'Enhances', 'Test-always-lang', 'Metapackage')
@@ -37,6 +37,7 @@
 DDTPURL = "http://ftp.de.debian.org/debian/dists/"
 DDTPDIR = "/i18n/Translation-"
 DDTPLISTS = ('etch', 'lenny', 'sid')
+DISTLIST = ['unstable', 'testing', 'stable', 'experimental']
 
 CONFDIR = 'webconf'
 
@@ -208,7 +209,12 @@
         # The following keys will be mostly used for programs that
         # are not yet existing in Debian and will go to our todo list
         self.homepage       = HOMEPAGENONE # Homepage of program
-        self.version        = None # Version of program
+        self.version        = {}   # List of Versions in different dists
+        for dist in DISTLIST:
+            self.version[dist] = None
+        self.oPkgURL        = {}   # List of URLs to packages in different dists
+        for dist in DISTLIST:
+            self.oPkgURL[dist] = None
         self.responsible    = None # E-Mail address of issuer of ITP or some person
                                    # who volunteered to care for this program
         self.license        = None # License of program
@@ -246,14 +252,14 @@
         # This Instance of the Available class contains all
         # information about packages that are avialable in Debian
         # See below for more information about Available class
-        global available
+        global available_list
 
         self.data            = ReadConfig(blendname)
         self.blendname       = self.data['Blend']
         self.tasksdir        = InitTasksFiles(self.data)
         self.tasks           = {} # Dictionary of TasksDependency objects
         self.metapackagekeys = []
-        self.available       = available
+        self.available_list  = available_list
         self.alldeps_in_main = [] # sorted string list of package names with all packages
                                   # relevant for a Blend that are in main Debian (for use in DDTP)
         self.alldeps_in_main_info = {} # complete dictionary with package information
@@ -520,7 +526,7 @@
                               'prospective' : [],
                               'unknown'     : []
                             }
-        self.available = available
+        self.available_list = available_list
 
         # Main information for a task
         self.metapkg             = DependantPackage(self.blendname, self.task)
@@ -562,7 +568,8 @@
     def GetTaskDependencies(self, source=0):
         # First obtain information about Packages
         # available in Debian
-        self.available.GetPackageNames()
+        for d in DISTLIST:
+            self.available_list[d].GetPackageNames()
 
         # These keys might contain more than one item that
         # has to be separated to detect the dependency
@@ -623,6 +630,8 @@
                         if dependency.strip() != '': # avoid confusion when ',' is at end of line
                             deps_in_one_line.append(dependency.strip())
 
+                    # start parsing with unstable
+                    available = self.available_list['unstable']
                     for dep_in_line in deps_in_one_line:
                         # If there are more than one dependencies in one line
                         # just put the current one into the right list of dependencies
@@ -634,10 +643,10 @@
                         dep.responsible    = responsible
                         dep.dep_strength   = key
                         dep.pkg            = dep_in_line
-                        dep.dists.append(self.available.dist)
+                        dep.dists.append(available.dist)
                         # Find the component the Dependency might be in
-                        for component in self.available.components:
-                            if dep.pkg in self.available.packages[component].keys():
+                        for component in available.components:
+                            if dep.pkg in available.packages[component].keys():
                                 dep.component    = component
                                 if component == 'main':
                                     dep.license = 'DFSG free'
@@ -647,24 +656,23 @@
                                     dep.license = 'non-free'
                                 else:
                                     dep.license = 'unknown'
-                                dep.desc['en']['short'] = self.available.packages[component][dep.pkg].desc['en']['short']
-                                dep.desc['en']['long']  = self.available.packages[component][dep.pkg].desc['en']['long']
-                                dep.homepage     = self.available.packages[component][dep.pkg].homepage
-                                dep.version      = self.available.packages[component][dep.pkg].version
-                                dep.section      = self.available.packages[component][dep.pkg].section
-                                dep.source       = self.available.packages[component][dep.pkg].source
-                                dep.VcsSvn       = self.available.packages[component][dep.pkg].VcsSvn
-                                dep.VcsBrowser   = self.available.packages[component][dep.pkg].VcsBrowser
-                                dep.responsible  = self.available.packages[component][dep.pkg].responsible
-                                # TODO: Assuming 'unstable' is wrong --> handle list of dists
-                                dep.pkgURL       = 'http://packages.debian.org/' + 'unstable/' + \
-                                                   self.available.packages[component][dep.pkg].section + \
-                                                   '/' + dep.pkg
-                                dep.filename     = self.available.packages[component][dep.pkg].filename
+                                dep.desc['en']['short'] = available.packages[component][dep.pkg].desc['en']['short']
+                                dep.desc['en']['long']  = available.packages[component][dep.pkg].desc['en']['long']
+                                dep.homepage            = available.packages[component][dep.pkg].homepage
+                                dep.version['unstable'] = available.packages[component][dep.pkg].version
+                                dep.section             = available.packages[component][dep.pkg].section
+                                dep.source              = available.packages[component][dep.pkg].source
+                                dep.VcsSvn              = available.packages[component][dep.pkg].VcsSvn
+                                dep.VcsBrowser          = available.packages[component][dep.pkg].VcsBrowser
+                                dep.responsible         = available.packages[component][dep.pkg].responsible
+                                dep.oPkgURL['unstable'] = 'http://packages.debian.org/' + dist + '/' + \
+                                                          available.packages[component][dep.pkg].section + \
+                                                          '/' + dep.pkg
+                                dep.filename            = available.packages[component][dep.pkg].filename
 
                                 # if we are seeking for source package names for ddpo subscription
-                                if source == 1 and self.available.packages[component][dep.pkg].source:
-                                    dep.pkg = self.available.packages[component][dep.pkg].source
+                                if source == 1 and available.packages[component][dep.pkg].source:
+                                    dep.pkg = available.packages[component][dep.pkg].source
                                     
                                 break # The same package should be only in one component
                                       # At least I currently see no reason for having a
@@ -713,7 +721,9 @@
                               % stanza['license']
                 elif key == 'WNPP':
                     if dep != None:
-                        if dep.pkg in self.available.packages[component].keys():
+                        # it makes sense to assume that a package where WNPP was recently closed
+                        # shows up in unstable first
+                        if dep.pkg in self.available_list['unstable'].packages[component].keys():
                             print "Hint: WNPP for package %s just closed - extra information can be removed from task file." % (dep.pkg)
                         else:
                     	    wnpp = stanza['wnpp'].strip()
@@ -900,5 +910,6 @@
                 self.packages[component][stanza['package']] = deppkg
             g.close()
 
-available = Available()
-
+available_list = {}
+for dist in DISTLIST:
+    available_list[dist] = Available(dist=dist)



More information about the Blends-commit mailing list