提交 f4a53b25 编写于 作者: A Ansgar Burchardt

Adapt to changes to Package-List field.

上级 c409b272
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册