소스 검색

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 18 년 전
부모
커밋
1073aae712
3개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  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
 	are already listed (one might want to use LD_LIBRARY_PATH to
 	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>
 

+ 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
     by looking up dpkg -S on the realpath of any symlink to a library.
     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 ]
   * Swedish (Peter Karlsson)

+ 4 - 2
scripts/dpkg-source.pl

@@ -502,11 +502,13 @@ if ($opmode eq 'build') {
         $tardirbase= $origdirbase; $tardirname= $origdirname;
 
 	$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>" .
 	               ".orig.tar (wanted %s)"),
 	            $tarname, "$basename.orig.tar.$comp_regex");
-	if (($1 ne 'gz') && ($f{'Format'} < 2)) { $f{'Format'} = '2.0' };
+	}
     } else {
 	$tardirbase= $dirbase; $tardirname= $dirname;
 	$tarname= "$basenamerev.tar.$comp_ext";