The following commit has been merged in the master branch:
commit c685b1289dd03e2c23728ee1a83047243f0e7578
Author: Ole Streicher <[email protected]>
Date:   Fri Apr 29 16:01:53 2016 +0200

    Lower dependency strength of alternative packages
    Packages that are listed in the tasks files as alternative of other packages
    delimited by "|" are usually only installed if the main package is not
    available. So, they are counted as lower priority packages.
    This commit moved them from "High urgency" to "low urgency".
    An example are the alternative Python 2 packages for existing Python 3
    packages: Since we are moving to Python 3, the Python 2 packages serve
    just as an low-urgency alternative of the Python 3 version.

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index 0c533f9..04d0dbf 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -1151,34 +1151,34 @@ class TaskDependencies:
                     # Remove versions from versioned depends
                     dependencies = re.sub(' *\([ ><=\.0-9]+\) *', '', 
dependencies)
 
-                    # turn alternatives ('|') into real depends for this 
purpose
-                    # because we are finally interested in all alternatives
-                    dependencies = dependencies.replace('|', ',')
-
                     for dep_in_line in dependencies.split(','):
                         dep_in_line = dep_in_line.strip()
                         if not dep_in_line:
                             continue
-                        # If there are more than one dependencies in one line
-                        # just put the current one into the right list of 
dependencies
-                        # before initiating the next instance
-                        if dep is not None:
-                            tmp_dep_list.append(dep)
-                        if not dep_in_line.islower():
-                            logger.warning("Package names may not contain 
upper case letters, so %s is an invalid package name which is turned into %s"
-                                           % (dep_in_line, 
dep_in_line.lower()))
-                            dep_in_line = dep_in_line.lower()
-                        dep = DependantPackage(dep_in_line)
-                        # Store the comments in case they might be usefull for 
later applications
-                        if why:
-                            dep.properties['why'] = why
-                        if responsible:
-                            (_name, _url) = email.utils.parseaddr(responsible)
-                            dep.properties['maintainer'] = {'name':_name, 
'email': _url}
-
-                        dep.properties['dep_strength'] = key
 
-                    continue
+                        # Each dependency may have alternatives delimited by 
"|".
+                        for i, dep_name in enumerate(dep_in_line.split('|')):
+                            dep_name = dep_name.strip()
+                            if not dep_name:
+                                continue
+
+                            if not dep_in_line.islower():
+                                logger.warning("Package names may not contain 
upper case letters, so %s is an invalid package name which is turned into %s"
+                                               % (dep_name, dep_name.lower()))
+                                dep_name = dep_name.lower()
+                            dep = DependantPackage(dep_name)
+                            # Store the comments in case they might be usefull 
for later applications
+                            if why:
+                                dep.properties['why'] = why
+                            if responsible:
+                                (_name, _url) = 
email.utils.parseaddr(responsible)
+                                dep.properties['maintainer'] = {'name':_name, 
'email': _url}
+                            if i > 0 and key == "Depends":
+                                # Alternatives will be lowered to suggestions.
+                                dep.properties['dep_strength'] = "Suggests"
+                            else:
+                                dep.properties['dep_strength'] = key
+                            tmp_dep_list.append(dep)
 
                 # sometimes the tasks file contains standalone comments or 
other RFC 822 entries.
                 # Just ignore this stuff
@@ -1347,7 +1347,6 @@ class TaskDependencies:
                     if flag == 1:
                         break
 
-            tmp_dep_list.append(dep)
             # remarks which are common to several dependencies in a list have
             # to be added to all of the dependencies
             for dep in tmp_dep_list:

-- 
Static and dynamic websites for Debian Pure Blends

_______________________________________________
Blends-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/blends-commit

Reply via email to