[Reproducible-commits] [dpkg] 10/37: Dpkg::Source::Patch: Only warn once when a diff patches a file multiple times

Jérémy Bobbio lunar at moszumanska.debian.org
Sun Jan 31 16:28:38 UTC 2016


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

lunar pushed a commit to branch pu/buildinfo
in repository dpkg.

commit 4313ec68d8fe5d4ccd8f345b576a0ddbe27a4931
Author: Guillem Jover <guillem at debian.org>
Date:   Sat Jan 16 20:46:48 2016 +0100

    Dpkg::Source::Patch: Only warn once when a diff patches a file multiple times
    
    Reword the warning message to make it clear that the diff might be
    patching the file more than once, not just twice, which might be
    incorrect. And only emit a single warning.
---
 debian/changelog             | 3 +++
 scripts/Dpkg/Source/Patch.pm | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4038173..775aaae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,9 @@ dpkg (1.18.5) UNRELEASED; urgency=medium
     - Make patching a file multiple times fatal for the first quilt patch in
       Dpkg::Source. Reported by Apollon Oikonomopoulos <apoikos at debian.org>.
       Closes: #810720
+    - Only warn once when a diff patches a file multiple times in
+      Dpkg::Source::Patch, and fix the warning message to make it clear that
+      the diff might be patchig the file more than once, not just twice.
   * Documentation:
     - Say value instead of option in deb-control(5).
     - Mark debian changelog format in bold in dpkg-parsechangelog(1).
diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm
index 36242e0..8d759af 100644
--- a/scripts/Dpkg/Source/Patch.pm
+++ b/scripts/Dpkg/Source/Patch.pm
@@ -491,12 +491,14 @@ sub analyze {
 	}
 
 	if ($filepatched{$fn}) {
+            $filepatched{$fn}++;
+
             if ($opts{fatal_dupes}) {
                 error(g_("diff '%s' patches files multiple times; split the " .
                          "diff in multiple files or merge the hunks into a " .
                          "single one"), $diff);
-            } elsif ($opts{verbose}) {
-                warning(g_("diff '%s' patches file %s twice"), $diff, $fn)
+            } elsif ($opts{verbose} and $filepatched{$fn} == 2) {
+                warning(g_("diff '%s' patches file %s more than once"), $diff, $fn)
             }
 	} else {
 	    $filepatched{$fn} = 1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list