[dpkg] 108/192: Dpkg::ErrorHandling: Move printforhelp initialization into usageerr()

Ximin Luo infinity0 at debian.org
Tue Oct 17 11:04:06 UTC 2017


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

infinity0 pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 600bf60bdf19b0857cf1fce0b01a281512b96dd2
Author: Guillem Jover <guillem at debian.org>
Date:   Sat Jul 15 15:27:25 2017 +0200

    Dpkg::ErrorHandling: Move printforhelp initialization into usageerr()
    
    This way we remove code executed at import time.
---
 debian/changelog              | 1 +
 scripts/Dpkg/ErrorHandling.pm | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index dfc86ff..0806d90 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,7 @@ dpkg (1.19.0) UNRELEASED; urgency=medium
     - Only load Term::ANSIColor from Dpkg::ErrorHandling if we are going to
       use colors, reducing the load time of many other modules.
     - Move color setup into report_pretty in Dpkg::ErrorHandling.
+    - Move printforhelp initialization into usageerr() in Dpkg::ErrorHandling.
   * Documentation:
     - Document currently accepted syntax for changelogs in deb-changelog(5).
       Closes: #858579
diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm
index a5b549f..e54acae 100644
--- a/scripts/Dpkg/ErrorHandling.pm
+++ b/scripts/Dpkg/ErrorHandling.pm
@@ -246,12 +246,12 @@ sub subprocerr(@)
     }
 }
 
-my $printforhelp = g_('Use --help for program usage information.');
-
 sub usageerr(@)
 {
     my ($msg) = (shift);
 
+    state $printforhelp = g_('Use --help for program usage information.');
+
     $msg = sprintf($msg, @_) if (@_);
     warn report(REPORT_ERROR, $msg);
     warn "\n$printforhelp\n";

-- 
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