Explorar o código

dpkg-source: do not allow underscore in component name for supplementary tarballs

According the documentation they were never meant to be allowed
but usage of perl's \w allowed them nevertheless. [\w-] has now been
replaced by [[:alnum:]-] everywhere so that the code fits the
documentation.
Raphaël Hertzog %!s(int64=16) %!d(string=hai) anos
pai
achega
ff03345b7a
Modificáronse 3 ficheiros con 7 adicións e 4 borrados
  1. 3 0
      debian/changelog
  2. 2 2
      scripts/Dpkg/Source/Package.pm
  3. 2 2
      scripts/Dpkg/Source/Package/V2.pm

+ 3 - 0
debian/changelog

@@ -17,6 +17,9 @@ dpkg (1.15.6.2) UNRELEASED; urgency=low
   * Fix dpkg to not lose package metadata on filesystems where readdir()
     returns new files added after the opendir() call, btrfs in particular
     triggered the problematic behaviour. Closes: #575891
+  * Tigthen the regex used by dpkg-source to match the component name of
+    supplementary tarballs so that undercore (_) are not allowed as it was
+    supposed to be.
 
   [ Updated dpkg translations ]
   * German (Sven Joachim).

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

@@ -233,7 +233,7 @@ sub find_original_tarballs {
 		($opts{include_main} and
 		 /^\Q$basename\E\.orig\.tar\.$opts{extension}$/) or
 		($opts{include_supplementary} and
-		 /^\Q$basename\E\.orig-[\w-]+\.tar\.$opts{extension}$/)
+		 /^\Q$basename\E\.orig-[[:alnum:]-]+\.tar\.$opts{extension}$/)
 	    } readdir(DIR);
         closedir(DIR);
     }
@@ -317,7 +317,7 @@ sub extract {
         my ($dirname, $destdir) = fileparse($newdirectory);
         $destdir ||= "./";
 	my $ext = $compression_re_file_ext;
-        foreach my $orig (grep { /^\Q$basename\E\.orig(-\w+)?\.tar\.$ext$/ }
+        foreach my $orig (grep { /^\Q$basename\E\.orig(-[[:alnum:]-]+)?\.tar\.$ext$/ }
                           $self->get_files())
         {
             my $src = File::Spec->catfile($self->{'basedir'}, $orig);

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

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