Bug#225086: dpkg-dev: dpkg-scanpackages incorrectly parses command-line options -a an -u
Package: dpkg-dev
Version: 1.10.18
Severity: important
Tags: sid patch
dpkg-scanpackages does not work with options -u and -a.
Examples:
$ dpkg-scanpackages -ai386 . override
Binary dir -ai386 not found
and
$ dpkg-scanpackages -u . override
Binary dir -u not found
Attached patch fixes this problem.
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux intel4 2.4.23 #1 Пнд Гру 15 18:06:41 EET 2003 i686
Locale: LANG=uk_UA, LC_CTYPE=uk_UA
Versions of packages dpkg-dev depends on:
ii binutils 2.14.90.0.7-3 The GNU assembler, linker and bina
ii cpio 2.5-1.1 GNU cpio -- a program to manage ar
ii make 3.80-4 The GNU version of the "make" util
ii patch 2.5.9-1 Apply a diff file to an original
ii perl [perl5] 5.8.2-2 Larry Wall's Practical Extraction
ii perl-modules 5.8.2-2 Core Perl modules.
-- no debconf information
--- dpkg-scanpackages.orig 2003-12-25 19:45:47.000000000 +0200
+++ dpkg-scanpackages 2003-12-25 19:37:03.000000000 +0200
@@ -33,7 +33,7 @@
$udeb = 0;
$arch = '';
-while ($ARGV[1] =~ m/^-.*/) {
+while ($ARGV[0] =~ m/^-.*/) {
my $opt = shift @ARGV;
if ($opt eq '-u') {
$udeb = 1;
@@ -49,11 +49,7 @@
}
}
$ext = $udeb ? 'udeb' : 'deb';
-$pattern = $arch ? "-name '*_all.$ext' -o -name '*_$arch.$ext'" : "-name '*.$ext'";
-if ($ARGV[1] eq '-u') {
- $udeb = 1;
- shift @ARGV;
-}
+$pattern = $arch ? "\\( -name '*_all.$ext' -o -name '*_$arch.$ext' \\)" : "-name '*.$ext'";
$#ARGV == 1 || $#ARGV == 2
or die "Usage: dpkg-scanpackages [-u] [-a<arch>] binarypath overridefile [pathprefix] > Packages\n";
Reply to: