chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Debugging output: Break out debugcmd into Dgit.pm and use it everywhere (nfc)
[dgit.git]
/
Debian
/
Dgit.pm
diff --git
a/Debian/Dgit.pm
b/Debian/Dgit.pm
index 5c079a68d3abfa8e4ce89b969027337244d4c53b..2b9479db58d9b4e5f07c0301033657d449475c75 100644
(file)
--- 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
@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} };
shellquote printcmd);
%EXPORT_TAGS = ( policyflags => [qw(NOFFCHECK FRESHREPO)] );
@EXPORT_OK = @{ $EXPORT_TAGS{policyflags} };
@@
-117,4
+118,9
@@
sub printcmd {
print $fh "\n" or die $!;
}
print $fh "\n" or die $!;
}
+sub debugcmd {
+ my $extraprefix = shift @_;
+ printcmd(\*::DEBUG,$debugprefix.$extraprefix,@_) if $debug>0;
+}
+
1;
1;