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.
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"
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