Przeglądaj źródła

Add -u -a<arch> commands.

Adam Heath 23 lat temu
rodzic
commit
66337940d0
4 zmienionych plików z 42 dodań i 2 usunięć
  1. 4 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 9 0
      scripts/dpkg-scanpackages.8
  4. 26 2
      scripts/dpkg-scanpackages.pl

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+Mon Oct 27 09:49:29 CST 2003 Adam Heath <doogie@debian.org>
+
+  * scripts/dpkg-scanpackages.pl: Add -u -a<arch> commands.
+
 Mon Oct 27 09:42:57 CST 2003 Adam Heath <doogie@debian.org>
 
   * scripts/dpkg-checkbuilddeps.pl: Set $reduce_arch when calling parsedep.

+ 3 - 0
debian/changelog

@@ -6,6 +6,9 @@ dpkg (1.10.17) unstable; urgency=medium
   * Branden Robinson <branden@debian.org>:
     s/dpkg-checkbuild/dpkg-checkbuilddeps/ in usage.
   * dpkg-checkbuilddeps now sets $reduce_arch.  Closes: #212796.
+  * Goswin Brederlow <brederlo@informatik.uni-tuebingen.de>:
+    Add -u in dpkg-scanpackages.  Closes: #214123.
+    Add -a<arch> command to dpkg-scanpackages.
 
  -- Wichert Akkerman <wakkerma@debian.org>  UNRELEASED
 

+ 9 - 0
scripts/dpkg-scanpackages.8

@@ -19,6 +19,8 @@ dpkg-scanpackages \- create Packages files
 .
 .SH SYNOPSIS
 .B dpkg-scanpackages
+.RI [ -u ]
+.RI [ -a<arch> ]
 .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<arch>\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,

+ 26 - 2
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<arch>] 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 (<F>) {
     chomp($fn=$_);