[Reproducible-commits] [dpkg] 79/105: scripts: Refactor command printing into new printcmd() function

Niko Tyni ntyni at moszumanska.debian.org
Mon May 2 13:49:55 UTC 2016


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

ntyni pushed a commit to branch ntyni/reproducible_builds
in repository dpkg.

commit 5833b05c482cc8346dd6e7c8785e76f85ed52d4d
Author: Guillem Jover <guillem at debian.org>
Date:   Thu Sep 17 18:01:16 2015 +0200

    scripts: Refactor command printing into new printcmd() function
---
 scripts/Dpkg/ErrorHandling.pm | 8 ++++++++
 scripts/dpkg-buildpackage.pl  | 6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm
index 7eef167..a77fe19 100644
--- a/scripts/Dpkg/ErrorHandling.pm
+++ b/scripts/Dpkg/ErrorHandling.pm
@@ -28,6 +28,7 @@ our @EXPORT = qw(
     error
     errormsg
     syserr
+    printcmd
     subprocerr
     usageerr
 );
@@ -91,6 +92,13 @@ sub errormsg($;@)
     print { *STDERR } report(g_('error'), @_);
 }
 
+sub printcmd
+{
+    my (@cmd) = @_;
+
+    print { *STDERR } " @cmd\n";
+}
+
 sub subprocerr(@)
 {
     my ($p) = (shift);
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 94be161..e4b8180 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -540,7 +540,7 @@ push @changes_opts, "-C$desc" if defined $desc;
 my $chg = "../$pva.changes";
 my $changes = Dpkg::Control->new(type => CTRL_FILE_CHANGES);
 
-print { *STDERR } " dpkg-genchanges @changes_opts >$chg\n";
+printcmd("dpkg-genchanges @changes_opts >$chg");
 
 open my $changes_fh, '-|', 'dpkg-genchanges', @changes_opts
     or subprocerr('dpkg-genchanges');
@@ -614,7 +614,7 @@ sub mustsetvar {
 }
 
 sub withecho {
-    print { *STDERR } " @_\n";
+    printcmd(@_);
     system(@_)
 	and subprocerr("@_");
 }
@@ -655,7 +655,7 @@ sub run_hook {
 sub signfile {
     my $file = shift;
 
-    print { *STDERR } " signfile $file\n";
+    printcmd("signfile $file");
 
     my $signdir = tempdir('dpkg-sign.XXXXXXXX', CLEANUP => 1);
     my $signfile = "$signdir/$file";

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