This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=4affcfaa170b3a36348b977ef6f3277b7fb12c99

commit 4affcfaa170b3a36348b977ef6f3277b7fb12c99
Author: Guillem Jover <[email protected]>
AuthorDate: Mon Jan 7 22:34:43 2019 +0100

    dpkg-scanpackages: Emit a warning with the list of repeat packages
    
    When not using --multiversion, track any repeated instance that would
    possibly benefit from running with --multiversion, and output it at the
    end with a suggestion to use that option.
    
    Prompted-by: Johannes Schauer <[email protected]>
---
 debian/changelog             | 2 ++
 scripts/dpkg-scanpackages.pl | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6fac0102c..c1d7d8181 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,8 @@ dpkg (1.19.3) UNRELEASED; urgency=medium
   * dpkg-scanpackages: Do not compute unnecessary checksums when using the
     --hash argument. Based on a patch by Chris Lamb <[email protected]>.
     Closes: #916456
+  * dpkg-scanpackages: Emit a warning with the list of repeat packages.
+    Prompted by Johannes Schauer <[email protected]>.
   * Perl modules:
     - Dpkg::Changelog::Debian: Preserve modelines at EOF. Closes: #916056
       Thanks to Chris Lamb <[email protected]> for initial test cases.
diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl
index bb0bebcf2..6d6d7946e 100755
--- a/scripts/dpkg-scanpackages.pl
+++ b/scripts/dpkg-scanpackages.pl
@@ -38,6 +38,7 @@ textdomain('dpkg-dev');
 report_options(info_fh => \*STDERR);
 
 my (@samemaint, @changedmaint);
+my @multi_instances;
 my @spuriousover;
 my %packages;
 my %overridden;
@@ -176,6 +177,9 @@ sub process_deb {
     if (defined($packages{$p}) and not $options{multiversion}) {
         my $pkg = ${$packages{$p}}[0];
 
+        @multi_instances = ($pkg->{Filename}) if @multi_instances == 0;
+        push @multi_instances, "$pathprefix$fn";
+
         if (version_compare_relation($fields->{'Version'}, REL_GT,
                                      $pkg->{'Version'}))
         {
@@ -274,6 +278,10 @@ for my $p (sort keys %packages) {
 }
 close(STDOUT) or syserr(g_("couldn't close stdout"));
 
+if (@multi_instances) {
+    warning(g_('Packages with multiple instances but no --multiversion 
specified:'));
+    warning($_) foreach (sort @multi_instances);
+}
 if (@changedmaint) {
     warning(g_('Packages in override file with incorrect old maintainer 
value:'));
     warning($_) foreach (@changedmaint);

-- 
Dpkg.Org's dpkg

Reply via email to