summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-02 19:27:06 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 11:54:09 +0100
commit0143e613578b90d0e320fe4bab748b7a8726fa13 (patch)
tree6dc08a15c088f9c88fb6a55874680931380cd08c
parent835d5026fd4c39a5012d1a0d64c85a2481a2c686 (diff)
Move a $debug check into printdebug (nfc)
-rw-r--r--Debian/Dgit.pm2
-rwxr-xr-xdgit2
2 files changed, 2 insertions, 2 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm
index 2b9479d..641a917 100644
--- a/Debian/Dgit.pm
+++ b/Debian/Dgit.pm
@@ -92,7 +92,7 @@ sub enabledebug () {
}
sub printdebug {
- print ::DEBUG $debugprefix, @_ or die $!;
+ print ::DEBUG $debugprefix, @_ or die $! if $debug>0;
}
sub shellquote {
diff --git a/dgit b/dgit
index 44cfb15..e99df73 100755
--- a/dgit
+++ b/dgit
@@ -410,7 +410,7 @@ sub cmdoutput_errok {
$!=0; $?=0;
{ local $/ = undef; $d = <P>; }
die $! if P->error;
- if (!close P) { printdebug "=>!$?\n" if $debug>0; return undef; }
+ if (!close P) { printdebug "=>!$?\n"; return undef; }
chomp $d;
$d =~ m/^.*/;
printdebug "=> \`$&'",(length $' ? '...' : ''),"\n" if $debug>0; #';