summaryrefslogtreecommitdiff
path: root/Debian
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 /Debian
parentc7bbe8b90ccd78ed753c7dba2dc3942528e7b478 (diff)
Debugging output: Break out debugcmd into Dgit.pm and use it everywhere (nfc)
Diffstat (limited to 'Debian')
-rw-r--r--Debian/Dgit.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm
index 5c079a6..2b9479d 100644
--- a/Debian/Dgit.pm
+++ b/Debian/Dgit.pm
@@ -17,7 +17,8 @@ BEGIN {
@EXPORT = qw(debiantag server_branch server_ref
stat_exists git_for_each_ref
$package_re $component_re $branchprefix
- initdebug enabledebug printdebug $debugprefix $debug
+ initdebug enabledebug printdebug debugcmd
+ $debugprefix $debug
shellquote printcmd);
%EXPORT_TAGS = ( policyflags => [qw(NOFFCHECK FRESHREPO)] );
@EXPORT_OK = @{ $EXPORT_TAGS{policyflags} };
@@ -117,4 +118,9 @@ sub printcmd {
print $fh "\n" or die $!;
}
+sub debugcmd {
+ my $extraprefix = shift @_;
+ printcmd(\*::DEBUG,$debugprefix.$extraprefix,@_) if $debug>0;
+}
+
1;