From 73da458bc57bad62b98c3e4582f27d6a3be62167 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 15 Nov 2014 13:13:05 +0100 Subject: [PATCH] patchutils.py: Another small fix to prefer the longest matching version string. --- debian/tools/patchutils.py | 15 +++++++++------ patches/Makefile | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/debian/tools/patchutils.py b/debian/tools/patchutils.py index d817ad6d..8e4b4bd7 100644 --- a/debian/tools/patchutils.py +++ b/debian/tools/patchutils.py @@ -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 = {} diff --git a/patches/Makefile b/patches/Makefile index 5a887678..d725a29f 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -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 },'; \