patchutils.py: Another small fix to prefer the longest matching version string.

This commit is contained in:
Sebastian Lackner 2014-11-15 13:13:05 +01:00
parent e12216c644
commit 73da458bc5
2 changed files with 10 additions and 7 deletions

View File

@ -296,19 +296,22 @@ def read_patch(filename):
return r.group(1).strip(), r.group(2).strip()
def _parse_subject(subject):
version = "(v|try|rev|take) *([0-9]+)"
subject = subject.strip()
if subject.endswith("."): subject = subject[:-1]
r = re.match("^\\[PATCH([^]]*)\\](.*)$", subject, re.IGNORECASE)
if r is not None:
subject = r.group(2).strip()
r = re.search("v([0-9]+)", r.group(1), re.IGNORECASE)
if r is not None: return subject, int(r.group(1))
r = re.match("^(.*)\\((v|try|rev|take) *([0-9]+)\\)$", subject, re.IGNORECASE)
r = re.search(version, r.group(1), re.IGNORECASE)
if r is not None: return subject, int(r.group(2))
r = re.match("^(.*)\\(%s\\)$" % version, subject, re.IGNORECASE)
if r is not None: return r.group(1).strip(), int(r.group(3))
r = re.match("^(.*)[., ] *(v|try|rev|take) *([0-9]+)$", subject, re.IGNORECASE)
r = re.match("^(.*)[.,] +%s$" % version, subject, re.IGNORECASE)
if r is not None: return r.group(1).strip(), int(r.group(3))
r = re.match("^([^:]+) %s: (.*)$" % version, subject, re.IGNORECASE)
if r is not None: return "%s: %s" % (r.group(1), r.group(4)), int(r.group(3))
r = re.match("^(.*) +%s$" % version, subject, re.IGNORECASE)
if r is not None: return r.group(1).strip(), int(r.group(3))
r = re.match("^([^:]+) v([0-9]+): (.*)$", subject, re.IGNORECASE)
if r is not None: return "%s: %s" % (r.group(1), r.group(3)), int(r.group(2))
return subject, 1
header = {}

View File

@ -1743,7 +1743,7 @@ winepulse-PulseAudio_Support.ok:
echo '+ { "Maarten Lankhorst", "winepulse: Add official warning wine doesn'\''t want to support winepulse.", 16 },'; \
echo '+ { "Maarten Lankhorst", "winepulse: Fix winmm tests.", 17 },'; \
echo '+ { "Maarten Lankhorst", "winepulse: Latency and compilation improvements.", 18 },'; \
echo '+ { "Juergen Tretthahn", "winepulse: API Compatibility with 1.5.2 onward,.", 2 },'; \
echo '+ { "Juergen Tretthahn", "winepulse: API Compatibility with 1.5.2 onward.", 2 },'; \
echo '+ { "Maarten Lankhorst", "winepulse: Fix low latency support.", 1 },'; \
echo '+ { "Maarten Lankhorst", "winepulse: drop realtime priority before thread destruction.", 1 },'; \
echo '+ { "Maarten Lankhorst", "winepulse: remove bogus SetEvent from pulse_started_callback.", 1 },'; \