From 66337940d0fe912b1ac5ca9eaafa20b6c3279717 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Mon, 27 Oct 2003 16:50:00 +0000 Subject: [PATCH] Add -u -a commands. --- ChangeLog | 4 ++++ debian/changelog | 3 +++ scripts/dpkg-scanpackages.8 | 9 +++++++++ scripts/dpkg-scanpackages.pl | 28 ++++++++++++++++++++++++++-- 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c47e294b..62490527 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Oct 27 09:49:29 CST 2003 Adam Heath + + * scripts/dpkg-scanpackages.pl: Add -u -a commands. + Mon Oct 27 09:42:57 CST 2003 Adam Heath * scripts/dpkg-checkbuilddeps.pl: Set $reduce_arch when calling parsedep. diff --git a/debian/changelog b/debian/changelog index 844c632b..0a5c2f71 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,9 @@ dpkg (1.10.17) unstable; urgency=medium * Branden Robinson : s/dpkg-checkbuild/dpkg-checkbuilddeps/ in usage. * dpkg-checkbuilddeps now sets $reduce_arch. Closes: #212796. + * Goswin Brederlow : + Add -u in dpkg-scanpackages. Closes: #214123. + Add -a command to dpkg-scanpackages. -- Wichert Akkerman UNRELEASED diff --git a/scripts/dpkg-scanpackages.8 b/scripts/dpkg-scanpackages.8 index 9521f446..c90555f9 100644 --- a/scripts/dpkg-scanpackages.8 +++ b/scripts/dpkg-scanpackages.8 @@ -19,6 +19,8 @@ dpkg-scanpackages \- create Packages files . .SH SYNOPSIS .B dpkg-scanpackages +.RI [ -u ] +.RI [ -a ] .I binarydir .I overridefile .RI [ pathprefix ] @@ -50,6 +52,13 @@ package fits into the distribution; see below. .PP .I pathprefix is an optional string to be prepended to the Filename fields. +.PP +If +.I -u +is specified, then scan for *.udeb, instead of *.deb. +.PP +When -a\fI\fP is specified, then instead of scanning for all debs, +a pattern consisting of *_all.deb and *_arch.deb is used. . .SH THE OVERRIDE FILE While most information about a package can be found in the control file, diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl index 50c85974..4f77944f 100755 --- a/scripts/dpkg-scanpackages.pl +++ b/scripts/dpkg-scanpackages.pl @@ -31,8 +31,32 @@ $version= '1.2.6'; # This line modified by Makefile $written=0; $i=100; grep($pri{$_}=$i--,@fieldpri); +$udeb = 0; +$arch = ''; +while ($ARGV[1] =~ m/^-.*/) { + my $opt = shift @ARGV; + if ($opt eq '-u') { + $udeb = 1; + } elsif ($opt =~ m/-a(.*)/) { + if ($1) { + $arch = $1; + } else { + $arch = shift @ARGV; + } + } else { + print STDERR "Unknown option($opt)!\n"; + exit(1); + } +} +$ext = $udeb ? 'udeb' : 'deb'; +$pattern = $arch ? "-name '*_all.$ext' -o -name '*_$arch.$ext'" : "-name '*.$ext'"; +if ($ARGV[1] eq '-u') { + $udeb = 1; + shift @ARGV; +} + $#ARGV == 1 || $#ARGV == 2 - or die "Usage: dpkg-scanpackages binarypath overridefile [pathprefix] > Packages\n"; + or die "Usage: dpkg-scanpackages [-u] [-a] binarypath overridefile [pathprefix] > Packages\n"; ($binarydir, $override, $pathprefix) = @ARGV; -d $binarydir or die "Binary dir $binarydir not found\n"; -e $override or die "Override file $override not found\n"; @@ -46,7 +70,7 @@ sub vercmp { } # The extra slash causes symlinks to be followed. -open(F,"find $binarydir/ -follow -name '*.deb' -print |") +open(F,"find $binarydir/ -follow $pattern -print |") or die "Couldn't open pipe to find: $!\n"; while () { chomp($fn=$_); -- 2.39.5