[Blends-commit] [SCM] website branch, master, updated. 089bd1edc808c64058f069e3c71ce624eff495c4

Ole Streicher olebole at debian.org
Sat Mar 19 22:05:04 UTC 2016


The following commit has been merged in the master branch:
commit 7cadd77568a822d3169bb7946281a11e25d4410d
Author: Ole Streicher <olebole at debian.org>
Date:   Sat Mar 19 22:52:44 2016 +0100

    MOve pkgstatus and component to properties

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index 50f3c50..f8f0a34 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -721,13 +721,11 @@ class DependantPackage:
         self.blendname      = blendname  # Blend that includes the package in dependency list
         self.taskname       = taskname   # Task which includes the Dependency
         self.pkg            = None  # Name of dependant package
-        self.source         = None  # Name of source package of the dependency
-        self.pkgstatus      = 'unknown'  # global pkgstatus: characterizes status of dependency, release, packaging status
         self.releases       = []    # List of releases a package might be in
-        self.component      = None  # One of: 'main', 'contrib', 'non-free', if a package shows up in several components which
-                                    # might happen over different releases, just prefer main over contrib over non-free
         self.properties     = {}
         self.properties['license']     = 'unknown'
+        self.properties['pkgstatus']     = 'unknown'
+        self.properties['component']     = None
         for field in HOMEPAGENONEFIELDS:
             self.properties[field]    = HOMEPAGENONE
         self.properties['Enhances'] = {}  # Dictionary Enhancing pkg name as key, Link to package information as value; empty in most cases
@@ -757,12 +755,8 @@ class DependantPackage:
               "pkg:"    + self.pkg
         if self.dep_strength:
             ret += ", Dep_strength: " + self.dep_strength
-        if self.pkgstatus:
-            ret += ", Pkg_status: "   + str(self.pkgstatus)
         if self.releases:
             ret += ", releases: "     + str(self.releases)
-        if self.component:
-            ret += ", component: "    + self.component
         if self.desc:
             ret += ", desc: "         + str(self.desc)
         for prop in self.properties:
@@ -991,7 +985,7 @@ class Tasks:
             for dep in use_dependencystatus:
                 for tdep in tdeps.dependencies[dep]:
                     # add only packages in main, because others do not have DDTP translations
-                    if tdep.component == 'main':
+                    if tdep.properties['component'] == 'main':
                         self.alldeps_in_main.append(tdep.pkg)
                         self.alldeps_in_main_info[tdep.pkg] = tdep
             # Also add meta package itself to make use of translated meta package description
@@ -1114,18 +1108,18 @@ class TaskDependencies:
             return
         if source != 1:
             # In general we can just add the dependency to the list
-            self.dependencies[dep.pkgstatus].append(dep)
+            self.dependencies[dep.properties['pkgstatus']].append(dep)
             return
 
         # if we are seeking for ddpo source packages we have to make sure that
         # no duplication occures
         hasnot = 1
-        for hasdep in self.dependencies[dep.pkgstatus]:
+        for hasdep in self.dependencies[dep.properties['pkgstatus']]:
             if hasdep.pkg == dep.pkg:
                 hasnot = 0
                 break
         if hasnot == 1:
-            self.dependencies[dep.pkgstatus].append(dep)
+            self.dependencies[dep.properties['pkgstatus']].append(dep)
 
     def GetTaskDependencies(self, source=0):
         global dep_strength_keys
@@ -1234,7 +1228,7 @@ class TaskDependencies:
                 # the following fields might be provided in the Blends tasks file for
                 # prospective packages.  This information should be ignored in case the
                 # package just exists at Debian mirrors
-                if pkgstatus[dep.pkgstatus]['order'] <= pkgstatus['experimental']['order']:
+                if pkgstatus[dep.properties['pkgstatus']]['order'] <= pkgstatus['experimental']['order']:
                     # for packages not in Debian we use the information from the tasks file
                     # if a package is in Debian we use the information from the Packages file (via UDD query)
                     # and the fields may not be overriden.  The list collects duplicated fields and will
@@ -1272,8 +1266,8 @@ class TaskDependencies:
                     else:
                         logger.error("Dep not initiated before %s %s -> something is wrong."
                                      % (key, stanza[key.lower()]))
-                    if dep.pkgstatus == 'unknown':
-                        dep.pkgstatus = 'pkgvcs'
+                    if dep.properties['pkgstatus'] == 'unknown':
+                        dep.properties['pkgstatus'] = 'pkgvcs'
                 elif key.lower() == 'vcs-browser':
                     if dep is not None:
                         if dep.vcs_found == 1:
@@ -1296,8 +1290,8 @@ class TaskDependencies:
                     else:
                         logger.error("Dep not initiated before Vcs-Browser %s -> something is wrong."
                                      % stanza['vcs-browser'])
-                    if dep.pkgstatus == 'unknown':
-                        dep.pkgstatus = 'pkgvcs'
+                    if dep.properties['pkgstatus'] == 'unknown':
+                        dep.properties['pkgstatus'] = 'pkgvcs'
                 elif key == 'section':
                     if dep is not None:
                         dep.properties[key.lower()]  = stanza[key.lower()]
@@ -1369,7 +1363,7 @@ class TaskDependencies:
                             fields_obsolete.append(key)
                             continue
                 elif key == 'Avoid' or key == 'Ignore':
-                    dep.pkgstatus = key.lower()
+                    dep.properties['pkgstatus'] = key.lower()
                 elif key == 'Remark':
                     (shortDesc, longDesc) = SplitDescription(stanza['remark'])
                     if shortDesc:
@@ -1391,7 +1385,7 @@ class TaskDependencies:
             # seek for certain field set in the tasks file to move the dependency into different
             # categories of development status of not yet included packages provided that there
             # is at least a package description given
-            if dep.pkgstatus == 'unknown' and dep.desc['en'] != {}:
+            if dep.properties['pkgstatus'] == 'unknown' and dep.desc['en'] != {}:
                 flag = 0
                 # first check those packages where some work was just done
                 for status in ['pkgvcs', 'unofficial', 'wnpp', 'prospective']:
@@ -1399,7 +1393,7 @@ class TaskDependencies:
                         if field in dep.properties:
                             if field in HOMEPAGENONEFIELDS and dep.properties[field] == HOMEPAGENONE :
                                 continue
-                            dep.pkgstatus = status
+                            dep.properties['pkgstatus'] = status
                             flag = 1
                             break
                     if flag == 1:
@@ -1411,7 +1405,7 @@ class TaskDependencies:
             for dep in tmp_dep_list:
                 if remark:
                     dep.properties['remark'] = remark
-                if fields_obsolete != [] and dep.pkgstatus != 'new':
+                if fields_obsolete != [] and dep.properties['pkgstatus'] != 'new':
                     logger.info("Package %s is an official package and has information in UDD. The following extra information can be removed from tasks file %s: %s"
                                 % (dep.pkg, dep.taskname, str(fields_obsolete)))
                 self._AppendDependency2List(dep, source)
@@ -1452,23 +1446,23 @@ class TaskDependencies:
                 # Now set the information for the package found in the database
                 # Debian Edu contains packages from main/debian-installer - that's why we use startswith here
                 if row['component'].startswith('main'):
-                    dep.component = 'main'
+                    dep.properties['component'] = 'main'
                     if dep.dep_strength == 'Depends' or dep.dep_strength == 'Recommends':
-                        dep.pkgstatus = 'official_high'
+                        dep.properties['pkgstatus'] = 'official_high'
                     elif dep.dep_strength == 'Suggests':
-                        dep.pkgstatus = 'official_low'
+                        dep.properties['pkgstatus'] = 'official_low'
                 else:
-                    dep.component = row['component']
+                    dep.properties['component'] = row['component']
                     # If a package is not found in main its status can be maximum non-free
-                    dep.pkgstatus = 'non-free'
+                    dep.properties['pkgstatus'] = 'non-free'
                 # if a package is released *only* in experimental decrease package status
                 if row['release'] == 'experimental':
-                    dep.pkgstatus = 'experimental'
+                    dep.properties['pkgstatus'] = 'experimental'
 
                 # move dependant package to different status list if needed because a status change was detected
-                if dep.pkgstatus != status:
+                if dep.properties['pkgstatus'] != status:
                     self.dependencies[status].remove(dep)
-                    self.dependencies[dep.pkgstatus].append(dep)
+                    self.dependencies[dep.properties['pkgstatus']].append(dep)
 
                 # Warn about remaining information of prospective package
                 if dep.desc['en'] and dep.desc['en']['short'] and 'debtags' not in dep.properties:
@@ -1476,7 +1470,7 @@ class TaskDependencies:
                     logger.info("WNPP for package %s just closed - extra information can be removed from task file %s."
                                 % (dep.pkg, dep.taskname))
 
-                dep.properties['license'] = license_in_component[dep.component]
+                dep.properties['license'] = license_in_component[dep.properties['component']]
                 for prop in PROPERTIES:
                     dep.properties[prop] = row[prop]
                 for prop in ('upstream_bugs', 'upstream_repository'):
@@ -1612,8 +1606,8 @@ class TaskDependencies:
                 if status != 'new':
                     self.dependencies[status].remove(dep)
                     self.dependencies['new'].append(dep)
-                dep.pkgstatus = 'new'
-                dep.component = row['component']
+                dep.properties['pkgstatus'] = 'new'
+                dep.properties['component'] = row['component']
                 dep.properties['version'].append({'archs':'all', 'release':'NEW',
                                                   'version':row['version']})
                 dep.properties['pkg-url'] = 'http://ftp-master.debian.org/new/%s_%s.html' % (row['source'], row['version'])
@@ -1691,8 +1685,8 @@ class TaskDependencies:
                     self.dependencies[status].remove(dep)
                     self.dependencies['pkgvcs'].append(dep)
                     status = 'pkgvcs'
-                dep.pkgstatus = status
-                dep.component = row['component']
+                dep.properties['pkgstatus'] = status
+                dep.properties['component'] = row['component']
                 dep.properties['version'].append({'archs':'all', 'release':'VCS',
                                                   'version':row['version']})
                 # Warn about remaining information of prospective package
@@ -1727,23 +1721,23 @@ class TaskDependencies:
         # Verify whether packages which are neither in pool, new, vcs nor virtual have sufficient information in task file
         for status in self.dependencies.keys():
             for dep in self.dependencies[status]:
-                if dep.pkg not in pkgs_in_pool and dep.pkg not in pkgs_in_new and dep.pkg not in pkgs_virtual and dep.pkgstatus in ('unknown', 'pkgvcs'):
+                if dep.pkg not in pkgs_in_pool and dep.pkg not in pkgs_in_new and dep.pkg not in pkgs_virtual and dep.properties['pkgstatus'] in ('unknown', 'pkgvcs'):
                     # If only Vcs fields are given than we currently do not know enough to print package information
-                    if dep.pkgstatus == 'pkgvcs' and (dep.properties['homepage'] == HOMEPAGENONE or dep.desc['en'] == {}):
+                    if dep.properties['pkgstatus'] == 'pkgvcs' and (dep.properties['homepage'] == HOMEPAGENONE or dep.desc['en'] == {}):
                         logger.error("Package %s in task %s has only Vcs information - please provide more information" % (dep.pkg, dep.taskname))
                         self.dependencies[status].remove(dep)
-                        # dep.pkgstatus == 'unknown'
+                        # dep.properties['pkgstatus'] == 'unknown'
                     if dep.properties['homepage'] == HOMEPAGENONE:
                         if dep.desc['en'] == {}:
                             logger.error("Package %s in task %s neither in pool nor new and is lacking homepage and description - ignored" % (dep.pkg, dep.taskname))
                         else:
-                            logger.error("Package %s in task %s neither in pool nor new and has no homepage information - ignored (%s)" % (dep.pkg, dep.taskname, dep.pkgstatus))
+                            logger.error("Package %s in task %s neither in pool nor new and has no homepage information - ignored (%s)" % (dep.pkg, dep.taskname, dep.properties['pkgstatus']))
                     else:
                         if dep.desc['en'] == {}:
                             logger.error("Package %s neither in pool nor new and has no description - ignored" % dep.pkg)
                 else:
                     # prevent printing WNPP of packages inside Debian
-                    if 'wnpp' in dep.properties and dep.pkgstatus not in ('wnpp', 'pkgvcs'):
+                    if 'wnpp' in dep.properties and dep.properties['pkgstatus'] not in ('wnpp', 'pkgvcs'):
                         del dep.properties['wnpp']
 
         for dependency in self.dependencies.keys():
@@ -1752,7 +1746,7 @@ class TaskDependencies:
 
     def _QueryUDD4Package(self, source):
 
-        query = "EXECUTE pkg_releases ('%s', '%s')" % (self.pkg, self.component)
+        query = "EXECUTE pkg_releases ('%s', '%s')" % (self.pkg, self.properties['component'])
         _execute_udd_query(query)
         has_official = 0
         for rel in curs.fetchall():
@@ -1770,15 +1764,15 @@ class TaskDependencies:
                 prefix = ', '
 
         if has_official == 1:
-            if self.component == 'main':
+            if self.properties['component'] == 'main':
                 if self.dep_strength == 'Depends' or self.dep_strength == 'Recommends':
-                    self.pkgstatus = 'official_high'
+                    self.properties['pkgstatus'] = 'official_high'
                 else:
-                    self.pkgstatus = 'official_low'
+                    self.properties['pkgstatus'] = 'official_low'
             else:
-                    self.pkgstatus = 'non-free'
+                    self.properties['pkgstatus'] = 'non-free'
         else:
-            self.pkgstatus = 'experimental'
+            self.properties['pkgstatus'] = 'experimental'
 
         if 'source' in self.properties:
             query = "EXECUTE src_vcs ('%s')" % (self.properties['source'])
diff --git a/webtools/blendstasktools_udd.py b/webtools/blendstasktools_udd.py
index 425401e..726bb18 100644
--- a/webtools/blendstasktools_udd.py
+++ b/webtools/blendstasktools_udd.py
@@ -678,13 +678,11 @@ class DependantPackage:
         self.taskname       = taskname   # Task which includes the Dependency
         self.pkg            = None  # Name of dependant package
         self.source         = None  # Name of source package of the dependency
-        self.pkgstatus      = 'unknown'  # global pkgstatus: characterizes status of dependency, release, packaging status
         self.releases       = []    # List of releases a package might be in
-        self.component      = None  # One of: 'main', 'contrib', 'non-free', if a package shows up in several components which
-                                    # might happen over different releases, just prefer main over contrib over non-free
-
         self.properties     = {}
         self.properties['license']     = 'unknown'
+        self.properties['pkgstatus']   = 'unknown'
+        self.properties['component']     = None
         for field in HOMEPAGENONEFIELDS:
             self.properties[field]    = HOMEPAGENONE
         self.properties['Enhances'] = {}  # Dictionary Enhancing pkg name as key, Link to package information as value; empty in most cases
@@ -718,12 +716,8 @@ class DependantPackage:
               "pkg:"    + self.pkg
         if self.dep_strength:
             ret += ", Dep_strength: " + self.dep_strength
-        if self.pkgstatus:
-            ret += ", Pkg_status: "   + str(self.pkgstatus)
         if self.releases:
             ret += ", releases: "     + str(self.releases)
-        if self.component:
-            ret += ", component: "    + self.component
         if self.desc:
             ret += ", desc: "         + str(self.desc)
         for prop in self.properties:
@@ -921,7 +915,7 @@ class Tasks:
             for dep in use_dependencystatus:
                 for tdep in tdeps.dependencies[dep]:
                     # add only packages in main, because others do not have DDTP translations
-                    if tdep.component == 'main':
+                    if tdep.properties['component'] == 'main':
                         self.alldeps_in_main.append(tdep.pkg)
                         self.alldeps_in_main_info[tdep.pkg] = tdep
             # Also add meta package itself to make use of translated meta package description
@@ -1035,7 +1029,7 @@ class TaskDependencies:
             return
 
         logger.debug("Appending package to list : %s" % dep.pkg)
-        self.dependencies[dep.pkgstatus].append(dep)
+        self.dependencies[dep.properties['pkgstatus']].append(dep)
         return
 
 
@@ -1067,37 +1061,37 @@ class TaskDependencies:
             # Debian Edu contains packages from main/debian-installer - that's why we use startswith here
             if pkg_src != 2:
                 if row['component'].startswith('main'):
-                    dep.component = 'main'
+                    dep.properties['component'] = 'main'
                     if dep.dep_strength == 'd' or dep.dep_strength == 'r':
-                        dep.pkgstatus = 'official_high'
+                        dep.properties['pkgstatus'] = 'official_high'
                     elif dep.dep_strength == 's':
-                        dep.pkgstatus = 'official_low'
+                        dep.properties['pkgstatus'] = 'official_low'
                     else:
-                        dep.pkgstatus = 'new'
+                        dep.properties['pkgstatus'] = 'new'
                         dep.properties['version'].append({'archs':'all', 'release':'NEW',
                                                           'version':row['version']})
                 else:
-                    dep.component = row['component']
+                    dep.properties['component'] = row['component']
                     # If a package is not found in main its status can be maximum non-free
-                    dep.pkgstatus = 'non-free'
+                    dep.properties['pkgstatus'] = 'non-free'
             elif pkg_src == 2:
-                dep.component = row['component']    
-                dep.pkgstatus = 'pkgvcs'
+                dep.properties['component'] = row['component']
+                dep.properties['pkgstatus'] = 'pkgvcs'
                 dep.properties['version'].append({'archs':'all', 'release':'VCS',
                                                   'version':row['version']})
             
             # if a package is released *only* in experimental decrease package status
             if row.get('release') == 'experimental':
-                dep.pkgstatus = 'experimental'
+                dep.properties['pkgstatus'] = 'experimental'
 
             if dep.dep_strength == 'i':
-                dep.pkgstatus = 'ignore'
+                dep.properties['pkgstatus'] = 'ignore'
             elif dep.dep_strength == 'a':
-                dep.pkgstatus = 'avoid'
+                dep.properties['pkgstatus'] = 'avoid'
 
 	        # license
-            if dep.component != None and pkg_src != 2:
-                dep.properties['license'] = license_in_component[dep.component]
+            if dep.properties['component'] != None and pkg_src != 2:
+                dep.properties['license'] = license_in_component[dep.properties['component']]
 
             for prop in PROPERTIES:
                 dep.properties[prop] = row[prop]
diff --git a/webtools/templates/packages.xhtml b/webtools/templates/packages.xhtml
index 32de69f..89ddb59 100644
--- a/webtools/templates/packages.xhtml
+++ b/webtools/templates/packages.xhtml
@@ -520,19 +520,19 @@ function show_fulldesc(hash) {
 			    </a>
 			  </li>
 			</py:if>
-			<py:if test="project.pkgstatus == 'new'">
+			<py:if test="project.properties['pkgstatus'] == 'new'">
 			  <li>
 			    <a href="${project.properties['pkg-url']}">NEW entry</a>
 			  </li>
 			</py:if>
-			<py:if test="project.pkgstatus in ('official_high', 'official_low', 'non-free', 'experimental')">
+			<py:if test="project.properties['pkgstatus'] in ('official_high', 'official_low', 'non-free', 'experimental')">
 			  <li>
 			    <a href="https://tracker.debian.org/pkg/${project.pkg}">
 			      Maintainer page
 			    </a>
 			  </li>
 			</py:if>
-			<py:if test="project.pkgstatus in ('official_high', 'official_low', 'non-free', 'experimental')">
+			<py:if test="project.properties['pkgstatus'] in ('official_high', 'official_low', 'non-free', 'experimental')">
 			  <li>
 			    <a href="https://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&src=${project.pkg}">
 			      Bugs
@@ -599,8 +599,8 @@ function show_fulldesc(hash) {
 			</py:if>
 		      </dd>
 		    </py:if>
-		    <py:if test="project.component == 'main'
-				 and project.pkgstatus in ('official_high', 'official_low', 'experimental')
+		    <py:if test="project.properties['component'] == 'main'
+				 and project.properties['pkgstatus'] in ('official_high', 'official_low', 'experimental')
 				 and (not 'screenshot' in project.properties or 'debtags' not in project.properties
 				      or (lang != 'en' and lang not in project.desc))">
 		      <dt>Improve entry</dt>
diff --git a/webtools/templates/tasks.xhtml b/webtools/templates/tasks.xhtml
index 79178de..d178ec8 100644
--- a/webtools/templates/tasks.xhtml
+++ b/webtools/templates/tasks.xhtml
@@ -96,7 +96,7 @@
                <a href="mailto:${project.properties['maintainer']['email']}">${project.properties['maintainer']['name']}</a> <span py:if="'uploader' in project.properties">(<a href="mailto:${project.properties['uploader']['email']}">${project.properties['uploader']['name']}</a>)</span>
              </div>
 	   </td>
-	   <td py:if="project.component and project.pkgstatus != 'new' and project.pkgstatus != 'pkgvcs'" class="project-info">
+	   <td py:if="'component' in project.properties and project.properties['pkgstatus'] != 'new' and project.properties['pkgstatus'] != 'pkgvcs'" class="project-info">
 	     <span py:if="project.properties['version']" class="tooltip" id="${project.pkg}-versions">
 	       <table class="versionclass">
 		 <tr><th colspan="3" class="versionclass"><strong>Versions of package ${project.pkg}</strong></th></tr>
@@ -144,14 +144,14 @@
 		 <span py:otherwise=""><a href="${project.properties['vcs']['browser']}">${project.properties['vcs'].get('type', 'Vcs')}</a></span>
 	       </span>
 	     </div>
-            <div py:if="lang != 'en' and project.component == 'main' and project.pkgstatus != 'new' and project.pkgstatus != 'pkgvcs'">
+            <div py:if="lang != 'en' and project.properties['component'] == 'main' and project.properties['pkgstatus'] != 'new' and project.properties['pkgstatus'] != 'pkgvcs'">
 	       <div py:choose="">
 	           <div class="trans" py:when="lang in project.desc"><a href="http://ddtp.debian.net/ddtss/index.cgi/${lang}/forexternalreview/${project.pkg}">${fixtranslation}</a></div>
 	           <div class="trans-missing" py:otherwise=""><a href="http://ddtp.debian.net/ddtss/index.cgi/${lang}/fetch?package=${project.pkg}">${translatedesc}</a></div>
                </div>
             </div>
-            <div class="language" py:if="'language' in project.properties and project.component != 'main'">Language: ${project.properties['language']}</div>
-            <div py:if="project.properties['version'] and (project.pkgstatus == 'new' or project.pkgstatus == 'pkgvcs')">Version: ${project.properties['version'][0]['version']}</div>
+            <div class="language" py:if="'language' in project.properties and project.properties['component'] != 'main'">Language: ${project.properties['language']}</div>
+            <div py:if="project.properties['version'] and (project.properties['pkgstatus'] == 'new' or project.properties['pkgstatus'] == 'pkgvcs')">Version: ${project.properties['version'][0]['version']}</div>
            </td>
          </tr>
          <tr>
@@ -197,7 +197,7 @@
 	       <span class="year" py:if="'year' in project.properties['published']">(${project.properties['published']['year']})</span>
 	     </div>
 	   </td>
-	   <td py:if="project.component and project.pkgstatus != 'new' and project.pkgstatus != 'pkgvcs'" class="project-icon">
+	   <td py:if="'component' in project.properties and project.properties['pkgstatus'] != 'new' and project.properties['pkgstatus'] != 'pkgvcs'" class="project-icon">
 	     <div py:choose="">
 	       <div py:when="'screenshot' in project.properties">
 		 <span class="tooltip" id="${project.pkg}-screenshot">

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list