Prechádzať zdrojové kódy

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 10 rokov pred
rodič
commit
c3eb166147

+ 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
   * Make dpkg-maintscript-helper conffile commands more robust. Check that
     conffile pathname arguments are absolute paths and verify version number
     conffile pathname arguments are absolute paths and verify version number
     to be valid. Thanks to David Kalnischkies <david@kalnischkies.de>.
     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:
   * Packaging:
     - Add liblocale-gettext-perl to libdpkg-perl Recommends.
     - Add liblocale-gettext-perl to libdpkg-perl Recommends.
     - Wrap and document dependency relationships.
     - Wrap and document dependency relationships.

+ 2 - 2
man/dpkg-scanpackages.man

@@ -25,7 +25,7 @@ dpkg\-scanpackages \- create Packages index files
 .
 .
 .SH SYNOPSIS
 .SH SYNOPSIS
 .B dpkg\-scanpackages
 .B dpkg\-scanpackages
-.RI [ option "...] " binary-dir
+.RI [ option "...] " binary-path
 .RI [ override-file
 .RI [ override-file
 .RI [ path-prefix ]]
 .RI [ path-prefix ]]
 .B >
 .B >
@@ -58,7 +58,7 @@ files except on local access (i.e.
 .B file://
 .B file://
 sources).
 sources).
 .PP
 .PP
-.I binary-dir
+.I binary-path
 is the name of the tree of the binary packages to process (for example,
 is the name of the tree of the binary packages to process (for example,
 .BR contrib/binary\-i386 ).
 .BR contrib/binary\-i386 ).
 It is best to make this relative to the root of the Debian archive,
 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) {
 if (defined $override and not -e $override) {
     error(g_('override file %s not found'), $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/;
     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) {
 foreach my $fn (@archives) {
     process_deb($pathprefix, $fn);
     process_deb($pathprefix, $fn);
 }
 }