Explorar o código

dpkg-source: accept dashes in component name of additional tarballs

The regular expression used to identify additional tarballs (used in
formats "2.0" and "3.0 (quilt)") was too strict and refused dashes. This
commit fixes that and documents the set of allowed characters in the
dpkg-source manual page.
Raphael Hertzog %!s(int64=17) %!d(string=hai) anos
pai
achega
64439508cc

+ 2 - 0
debian/changelog

@@ -55,6 +55,8 @@ dpkg (1.15.1) UNRELEASED; urgency=low
     available. Closes: #523329
   * dpkg-gencontrol now handles properly (empty) dependencies which contain
     only spaces. Closes: #522787
+  * dpkg-source now accepts additional tarballs (in format "3.0 (quilt)")
+    with a "component" name containing dashes. Closes: #524376
 
   [ Guillem Jover ]
   * Fix typo in dpkg output (‘unexecpted’ → ‘unexpected’). Closes: #519082

+ 1 - 0
man/dpkg-source.1

@@ -354,6 +354,7 @@ an original tarball (\fB.orig.tar.\fP\fIext\fP where \fIext\fP can be
 \fBgz\fP, \fBbz2\fP and \fBlzma\fP) and a debian tarball
 (\fB.debian.tar.\fP\fIext\fP). It can also contain additional original
 tarballs (\fB.orig-\fP\fIcomponent\fP\fB.tar.\fP\fIext\fP).
+\fIcomponent\fP can only contain alphanumeric characters and dashes ("-").
 .PP
 .B Extracting
 .PP

+ 1 - 1
scripts/Dpkg/Source/Package.pm

@@ -259,7 +259,7 @@ sub find_original_tarballs {
         next unless defined($dir) and -d $dir;
         opendir(DIR, $dir) || syserr(_g("cannot opendir %s"), $dir);
         push @tar, map { "$dir/$_" }
-                  grep { /^\Q$basename\E\.orig(-\w+)?\.tar\.$ext$/ }
+                  grep { /^\Q$basename\E\.orig(-[\w-]+)?\.tar\.$ext$/ }
                   readdir(DIR);
         closedir(DIR);
     }

+ 2 - 2
scripts/Dpkg/Source/Package/V2.pm

@@ -97,7 +97,7 @@ sub do_extract {
         $seen{$uncompressed} = 1;
         if ($file =~ /^\Q$basename\E\.orig\.tar\.$comp_regex$/) {
             $tarfile = $file;
-        } elsif ($file =~ /^\Q$basename\E\.orig-(\w+)\.tar\.$comp_regex$/) {
+        } elsif ($file =~ /^\Q$basename\E\.orig-([\w-]+)\.tar\.$comp_regex$/) {
             $origtar{$1} = $file;
         } elsif ($file =~ /^\Q$basenamerev\E\.debian\.tar\.$comp_regex$/) {
             $debianfile = $file;
@@ -250,7 +250,7 @@ sub do_build {
             $tarfile = $_;
             push @origtarballs, $_;
             $self->add_file($_);
-        } elsif (/\.orig-(\w+)\.tar\.$comp_regex$/) {
+        } elsif (/\.orig-([\w-]+)\.tar\.$comp_regex$/) {
             $origtar{$1} = $_;
             push @origtarballs, $_;
             $self->add_file($_);