sponsor-patch: Fix crash if Debian patch contains a slash.

This commit is contained in:
Benjamin Drung 2012-08-01 15:16:34 +02:00
parent 9baf39a262
commit f29e729852
2 changed files with 2 additions and 1 deletions

1
debian/changelog vendored
View File

@ -19,6 +19,7 @@ ubuntu-dev-tools (0.144) UNRELEASED; urgency=low
[ Benjamin Drung ] [ Benjamin Drung ]
* seeded-in-ubuntu: State in error message that it takes a source package. * seeded-in-ubuntu: State in error message that it takes a source package.
(LP: #1029155) (LP: #1029155)
* sponsor-patch: Fix crash if Debian patch contains a slash.
-- Stefano Rivera <stefanor@ubuntu.com> Wed, 18 Jul 2012 12:47:01 +0200 -- Stefano Rivera <stefanor@ubuntu.com> Wed, 18 Jul 2012 12:47:01 +0200

View File

@ -28,7 +28,7 @@ class Patch(object):
def __init__(self, patch): def __init__(self, patch):
self._patch = patch self._patch = patch
self._patch_file = re.sub(" ", "_", patch.title) self._patch_file = re.sub(" |/", "_", patch.title)
if not reduce(lambda r, x: r or self._patch.title.endswith(x), if not reduce(lambda r, x: r or self._patch.title.endswith(x),
(".debdiff", ".diff", ".patch"), False): (".debdiff", ".diff", ".patch"), False):
Logger.info("Patch %s does not have a proper file extension." % \ Logger.info("Patch %s does not have a proper file extension." % \