提交 0262d251 编写于 作者: J James Troup

[rmurray] Handle 'Source (Version)' in Source: in .changes files.

上级 6f984c8f
2007-02-08 Ryan Murray <rmurray@debian.org>
* daklib/utils.py (re_srchasver): new regex.
(parse_changes): use regex to split 'Source (Version)' style
Source fields into 'source' and 'source-version'.
* config/debian/cron.daily: use $base instead of hardcoding path
name.
......
......@@ -42,6 +42,8 @@ re_taint_free = re.compile(r"^[-+~/\.\w]+$")
re_parse_maintainer = re.compile(r"^\s*(\S.*\S)\s*\<([^\>]+)\>")
re_srchasver = re.compile(r"^(\S+)\s+\((\S+)\)$")
changes_parse_error_exc = "Can't parse line in .changes file"
invalid_dsc_format_exc = "Invalid .dsc file"
nk_format_exc = "Unknown Format: in .changes file"
......@@ -223,6 +225,14 @@ The rules for (signing_rules == 1)-mode are:
changes_in.close()
changes["filecontents"] = "".join(lines)
if changes.has_key("source"):
# Strip the source version in brackets from the source field,
# put it in the "source-version" field instead.
srcver = re_srchasver.search(changes["source"])
if srcver:
changes["source"] = srcver.group(1)
changes["source-version"] = srcver.group(2)
if error:
raise changes_parse_error_exc, error
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册