From: Raphael Hertzog Date: Thu, 22 Nov 2007 17:35:34 +0000 (+0100) Subject: dpkg-source: fix regex used to identify extension of .orig tarball X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1073aae7127d1912acbebbcc6dfd3379b1b06d74;p=dpkg 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. --- diff --git a/ChangeLog b/ChangeLog index 42e0c4c1..fc4bb345 100644 --- a/ChangeLog +++ b/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 diff --git a/debian/changelog b/debian/changelog index 5b14a49a..6b64d0fa 100644 --- a/debian/changelog +++ b/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) diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index b82b9d14..94589c62 100755 --- a/scripts/dpkg-source.pl +++ b/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 _" . ".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";