Merge lp:~wgrant/launchpad/bug-685764 into lp:launchpad

Proposed by William Grant on 2010-12-06
Status: Merged
Approved by: Henning Eggers on 2010-12-08
Approved revision: no longer in the source branch.
Merged at revision: 12030
Proposed branch: lp:~wgrant/launchpad/bug-685764
Merge into: lp:launchpad
Diff against target: 25 lines (+2/-2)
2 files modified
lib/lp/archiveuploader/tests/test_utils.py (+1/-1)
lib/lp/archiveuploader/utils.py (+1/-1)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-685764
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code 2010-12-06 Approve on 2010-12-06
Review via email: mp+42814@code.launchpad.net

Commit Message

[r=jelmer][ui=none][bug=685764] Component orig tarballs with underscores in the name are now correctly parsed. Landed by henninge.

Description of the Change

lp.archiveuploader.utils.re_issource currently matches "matplotlib_1.0.1.orig-sample_data.tar.gz" as ('matplotlib_1.0.1.orig-sample', 'data', 'tar.gz'), when it should in fact be parsed as ('matplotlib', '1.0.1', 'orig-sample_data.tar.gz'). This branch fixes the regex to exclude underscores from the first component, fixing this misinterpretation.

To post a comment you must log in.
Jelmer Vernooij (jelmer) wrote :

Straightforward fix. Thanks.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archiveuploader/tests/test_utils.py'
2--- lib/lp/archiveuploader/tests/test_utils.py 2010-12-01 11:26:57 +0000
3+++ lib/lp/archiveuploader/tests/test_utils.py 2010-12-06 07:36:14 +0000
4@@ -237,7 +237,7 @@
5 extensions = (
6 'dsc', 'tar.gz', 'tar.bz2', 'diff.gz', 'orig.tar.gz',
7 'orig.tar.bz2', 'orig-bar.tar.gz', 'orig-bar.tar.bz2',
8- 'debian.tar.gz', 'debian.tar.bz2')
9+ 'orig-foo_bar.tar.gz', 'debian.tar.gz', 'debian.tar.bz2')
10 for extension in extensions:
11 self.assertEquals(
12 ('foo-bar', '1.0', extension),
13
14=== modified file 'lib/lp/archiveuploader/utils.py'
15--- lib/lp/archiveuploader/utils.py 2010-12-01 11:26:57 +0000
16+++ lib/lp/archiveuploader/utils.py 2010-12-06 07:36:14 +0000
17@@ -60,7 +60,7 @@
18 'orig(?:-.+)?\.tar\.(?:gz|bz2)', 'diff.gz',
19 '(?:debian\.)?tar\.(?:gz|bz2)', 'dsc']
20 re_issource = re.compile(
21- r"(.+)_(.+?)\.(%s)" % "|".join(ext for ext in source_file_exts))
22+ r"([^_]+)_(.+?)\.(%s)" % "|".join(ext for ext in source_file_exts))
23 re_is_component_orig_tar_ext = re.compile(r"^orig-(.+).tar.(?:gz|bz2)$")
24 re_is_orig_tar_ext = re.compile(r"^orig.tar.(?:gz|bz2)$")
25 re_is_debian_tar_ext = re.compile(r"^debian.tar.(?:gz|bz2)$")