← Back to team overview

launchpad-reviewers team mailing list archive

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

 

William Grant has proposed merging lp:~wgrant/launchpad/bug-685764 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #685764 re_issource doesn't handle component orig tarballs with underscores
  https://bugs.launchpad.net/bugs/685764


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.
-- 
https://code.launchpad.net/~wgrant/launchpad/bug-685764/+merge/42814
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-685764 into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/tests/test_utils.py'
--- lib/lp/archiveuploader/tests/test_utils.py	2010-12-01 11:26:57 +0000
+++ lib/lp/archiveuploader/tests/test_utils.py	2010-12-06 07:36:14 +0000
@@ -237,7 +237,7 @@
         extensions = (
             'dsc', 'tar.gz', 'tar.bz2', 'diff.gz', 'orig.tar.gz',
             'orig.tar.bz2', 'orig-bar.tar.gz', 'orig-bar.tar.bz2',
-            'debian.tar.gz', 'debian.tar.bz2')
+            'orig-foo_bar.tar.gz', 'debian.tar.gz', 'debian.tar.bz2')
         for extension in extensions:
             self.assertEquals(
                 ('foo-bar', '1.0', extension),

=== modified file 'lib/lp/archiveuploader/utils.py'
--- lib/lp/archiveuploader/utils.py	2010-12-01 11:26:57 +0000
+++ lib/lp/archiveuploader/utils.py	2010-12-06 07:36:14 +0000
@@ -60,7 +60,7 @@
     'orig(?:-.+)?\.tar\.(?:gz|bz2)', 'diff.gz',
     '(?:debian\.)?tar\.(?:gz|bz2)', 'dsc']
 re_issource = re.compile(
-    r"(.+)_(.+?)\.(%s)" % "|".join(ext for ext in source_file_exts))
+    r"([^_]+)_(.+?)\.(%s)" % "|".join(ext for ext in source_file_exts))
 re_is_component_orig_tar_ext = re.compile(r"^orig-(.+).tar.(?:gz|bz2)$")
 re_is_orig_tar_ext = re.compile(r"^orig.tar.(?:gz|bz2)$")
 re_is_debian_tar_ext = re.compile(r"^debian.tar.(?:gz|bz2)$")