Procházet zdrojové kódy

dpkg-source: fix regex used to identify extension of .orig tarball

Regex special meta-characters (mainly like "+" in versions) embedded in $basename
made the regex fail which resulted in unwanted upgrade of source packages to
Format: 2.0.
Raphael Hertzog před 18 roky
rodič
revize
1073aae712
3 změnil soubory, kde provedl 9 přidání a 2 odebrání
  1. 2 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 4 2
      scripts/dpkg-source.pl

+ 2 - 0
ChangeLog

@@ -9,6 +9,8 @@
 	at the beginning of the list of path to search, even if they
 	at the beginning of the list of path to search, even if they
 	are already listed (one might want to use LD_LIBRARY_PATH to
 	are already listed (one might want to use LD_LIBRARY_PATH to
 	change the search order).
 	change the search order).
+	* scripts/dpkg-source.pl: Fix regex used to identify the extension
+	of the orig.tar.{gz,bz2,lzma} file.
 
 
 2007-11-21  Raphael Hertzog  <hertzog@debian.org>
 2007-11-21  Raphael Hertzog  <hertzog@debian.org>
 
 

+ 3 - 0
debian/changelog

@@ -11,6 +11,9 @@ dpkg (1.14.10) UNRELEASED; urgency=low
   * dpkg-shlibdeps will try harder to identify packages providing a library
   * dpkg-shlibdeps will try harder to identify packages providing a library
     by looking up dpkg -S on the realpath of any symlink to a library.
     by looking up dpkg -S on the realpath of any symlink to a library.
     Closes: #452339
     Closes: #452339
+  * dpkg-source now correctly identifies the extension of the
+    orig.tar.{gz,bz2,lzma} file and won't unexpectedly create "Format: 2.0"
+    .dsc files.
 
 
   [ Updated man pages translations ]
   [ Updated man pages translations ]
   * Swedish (Peter Karlsson)
   * Swedish (Peter Karlsson)

+ 4 - 2
scripts/dpkg-source.pl

@@ -502,11 +502,13 @@ if ($opmode eq 'build') {
         $tardirbase= $origdirbase; $tardirname= $origdirname;
         $tardirbase= $origdirbase; $tardirname= $origdirname;
 
 
 	$tarname= $origtargz || "$basename.orig.tar.$comp_ext";
 	$tarname= $origtargz || "$basename.orig.tar.$comp_ext";
-	$tarname =~ /$basename.orig.tar.($comp_regex)/ ||
+	if ($tarname =~ /\Q$basename\E\.orig\.tar\.($comp_regex)/) {
+	    if (($1 ne 'gz') && ($f{'Format'} < 2)) { $f{'Format'} = '2.0' };
+	} else {
 	    warning(_g(".orig.tar name %s is not <package>_<upstreamversion>" .
 	    warning(_g(".orig.tar name %s is not <package>_<upstreamversion>" .
 	               ".orig.tar (wanted %s)"),
 	               ".orig.tar (wanted %s)"),
 	            $tarname, "$basename.orig.tar.$comp_regex");
 	            $tarname, "$basename.orig.tar.$comp_regex");
-	if (($1 ne 'gz') && ($f{'Format'} < 2)) { $f{'Format'} = '2.0' };
+	}
     } else {
     } else {
 	$tardirbase= $dirbase; $tardirname= $dirname;
 	$tardirbase= $dirbase; $tardirname= $dirname;
 	$tarname= "$basenamerev.tar.$comp_ext";
 	$tarname= "$basenamerev.tar.$comp_ext";