]> git.decadent.org.uk Git - dak.git/commitdiff
Adapt to changes to Package-List field.
authorAnsgar Burchardt <ansgar@debian.org>
Fri, 11 Nov 2011 21:11:06 +0000 (21:11 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Fri, 11 Nov 2011 21:11:06 +0000 (21:11 +0000)
daklib/queue.py
daklib/utils.py

index f6593394645c2c385fbf5ead34830b2bc83c5422..b7c2249ee3fb0868e8c5ea5fbd1c2c6100b7b1c0 100755 (executable)
@@ -51,7 +51,7 @@ from holding import Holding
 from urgencylog import UrgencyLog
 from dbconn import *
 from summarystats import SummaryStats
-from utils import parse_changes, check_dsc_files, build_package_set
+from utils import parse_changes, check_dsc_files, build_package_list
 from textutils import fix_maintainer
 from lintian import parse_lintian_output, generate_reject_messages
 from contents import UnpackedSource
@@ -133,8 +133,8 @@ def determine_new(filename, changes, files, warn=1, session = None, dsc = None,
 
     # Try to get the Package-Set field from an included .dsc file (if possible).
     if dsc:
-        for package, entry in build_package_set(dsc, session).items():
-            if not new.has_key(package):
+        for package, entry in build_package_list(dsc, session).items():
+            if package not in new:
                 new[package] = entry
 
     # Build up a list of potentially new things
index c144624a21b13b2872b455badccfd8279bb31efb..5e702b04d51a182cd3ee5f82ff8c2d1b5edf4cb0 100755 (executable)
@@ -577,39 +577,28 @@ def build_file_list(changes, is_a_dsc=0, field="files", hashname="md5sum"):
 ################################################################################
 
 # see http://bugs.debian.org/619131
-def build_package_set(dsc, session = None):
-    if not dsc.has_key("package-set"):
+def build_package_list(dsc, session = None):
+    if not dsc.has_key("package-list"):
         return {}
 
     packages = {}
 
-    for line in dsc["package-set"].split("\n"):
+    for line in dsc["package-list"].split("\n"):
         if not line:
             break
 
-        (name, section, priority) = line.split()
-        (section, component) = extract_component_from_section(section)
-
-        package_type = "deb"
-        if name.find(":") != -1:
-            (package_type, name) = name.split(":", 1)
-        if package_type == "src":
-            package_type = "dsc"
+        fields = line.split()
+        name = fields[0]
+        package_type = fields[1]
+        (section, component) = extract_component_from_section(fields[2])
+        priority = fields[3]
 
         # Validate type if we have a session
         if session and get_override_type(package_type, session) is None:
             # Maybe just warn and ignore? exit(1) might be a bit hard...
-            utils.fubar("invalid type (%s) in Package-Set." % (package_type))
-
-        if section == "":
-            section = "-"
-        if priority == "":
-            priority = "-"
-
-        if package_type == "dsc":
-            priority = "source"
+            utils.fubar("invalid type (%s) in Package-List." % (package_type))
 
-        if not packages.has_key(name) or packages[name]["type"] == "dsc":
+        if name not in packages or packages[name]["type"] == "dsc":
             packages[name] = dict(priority=priority, section=section, type=package_type, component=component, files=[])
 
     return packages