summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-02 18:58:54 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 11:54:08 +0100
commit835d5026fd4c39a5012d1a0d64c85a2481a2c686 (patch)
tree2427678b45bdb3d26a45e43f801685fd96476887 /dgit
parentc7bbe8b90ccd78ed753c7dba2dc3942528e7b478 (diff)
Debugging output: Break out debugcmd into Dgit.pm and use it everywhere (nfc)
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit12
1 files changed, 6 insertions, 6 deletions
diff --git a/dgit b/dgit
index 268f356..44cfb15 100755
--- a/dgit
+++ b/dgit
@@ -386,7 +386,7 @@ sub failedcmd {
}
sub runcmd {
- printcmd(\*DEBUG,$debugprefix."+",@_) if $debug>0;
+ debugcmd "+",@_;
$!=0; $?=0;
failedcmd @_ if system @_;
}
@@ -404,7 +404,7 @@ sub printdone {
sub cmdoutput_errok {
die Dumper(\@_)." ?" if grep { !defined } @_;
- printcmd(\*DEBUG,$debugprefix."|",@_) if $debug>0;
+ debugcmd "|",@_;
open P, "-|", @_ or die $!;
my $d;
$!=0; $?=0;
@@ -911,7 +911,7 @@ sub sshpsql ($$$) {
access_runeinfo("ssh-psql $runeinfo").
" export LC_MESSAGES=C; export LC_CTYPE=C;".
" ".shellquote qw(psql -A), $dbname, qw(-c), $sql);
- printcmd(\*DEBUG,$debugprefix."|",@cmd) if $debug>0;
+ debugcmd "|",@cmd;
open P, "-|", @cmd or die $!;
while (<P>) {
chomp or die;
@@ -1503,7 +1503,7 @@ sub pull () {
sub check_not_dirty () {
return if $ignoredirty;
my @cmd = (@git, qw(diff --quiet HEAD));
- printcmd(\*DEBUG,$debugprefix."+",@cmd) if $debug>0;
+ debugcmd "+",@cmd;
$!=0; $?=0; system @cmd;
return if !$! && !$?;
if (!$! && $?==256) {
@@ -1695,7 +1695,7 @@ sub dopush () {
changedir '../../../..';
my $diffopt = $debug>0 ? '--exit-code' : '--quiet';
my @diffcmd = (@git, qw(diff), $diffopt, $tree);
- printcmd \*DEBUG,$debugprefix."+",@diffcmd;
+ debugcmd "+",@diffcmd;
$!=0; $?=0;
my $r = system @diffcmd;
if ($r) {
@@ -1993,7 +1993,7 @@ sub cmd_rpush {
push @rdgit, qw(remote-push-build-host), (scalar @rargs), @rargs;
push @rdgit, @ARGV;
my @cmd = (@ssh, $host, shellquote @rdgit);
- printcmd \*DEBUG,$debugprefix."+",@cmd;
+ debugcmd "+",@cmd;
if (defined $initiator_tempdir) {
rmtree $initiator_tempdir;