Browse Source

dpkg-scanpackages: Support scanning a single binary file

This makes it possible to pass a binary package pathname so that the
tree does not need to be traversed. This also makes this command
symetric with dpkg-scansources.

Closes: #833964
Signed-off-by: Guillem Jover <guillem@debian.org>
Javier Serrano Polo 7 years ago
parent
commit
c3eb166147
3 changed files with 8 additions and 6 deletions
  1. 2 0
      debian/changelog
  2. 2 2
      man/dpkg-scanpackages.man
  3. 4 4
      scripts/dpkg-scanpackages.pl

+ 2 - 0
debian/changelog

@@ -4,6 +4,8 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
   * Make dpkg-maintscript-helper conffile commands more robust. Check that
     conffile pathname arguments are absolute paths and verify version number
     to be valid. Thanks to David Kalnischkies <david@kalnischkies.de>.
+  * Add support to dpkg-scanpackages for scanning a single binary file.
+    Thanks to Javier Serrano Polo <javier@jasp.net>. Closes: #833964
   * Packaging:
     - Add liblocale-gettext-perl to libdpkg-perl Recommends.
     - Wrap and document dependency relationships.

+ 2 - 2
man/dpkg-scanpackages.man

@@ -25,7 +25,7 @@ dpkg\-scanpackages \- create Packages index files
 .
 .SH SYNOPSIS
 .B dpkg\-scanpackages
-.RI [ option "...] " binary-dir
+.RI [ option "...] " binary-path
 .RI [ override-file
 .RI [ path-prefix ]]
 .B >
@@ -58,7 +58,7 @@ files except on local access (i.e.
 .B file://
 sources).
 .PP
-.I binary-dir
+.I binary-path
 is the name of the tree of the binary packages to process (for example,
 .BR contrib/binary\-i386 ).
 It is best to make this relative to the root of the Debian archive,

+ 4 - 4
scripts/dpkg-scanpackages.pl

@@ -231,10 +231,10 @@ foreach my $alg (keys %hash) {
     }
 }
 
-my ($binarydir, $override, $pathprefix) = @ARGV;
+my ($binarypath, $override, $pathprefix) = @ARGV;
 
-if (not -d $binarydir) {
-    error(g_('binary directory %s not found'), $binarydir);
+if (not -e $binarypath) {
+    error(g_('binary path %s not found'), $binarypath);
 }
 if (defined $override and not -e $override) {
     error(g_('override file %s not found'), $override);
@@ -253,7 +253,7 @@ my $scan_archives = sub {
     push @archives, $File::Find::name if m/$find_filter/;
 };
 
-find({ follow => 1, follow_skip => 2, wanted => $scan_archives}, $binarydir);
+find({ follow => 1, follow_skip => 2, wanted => $scan_archives}, $binarypath);
 foreach my $fn (@archives) {
     process_deb($pathprefix, $fn);
 }