chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Dgit.pm: Move shell_cmd from dgit
[dgit.git]
/
Debian
/
Dgit.pm
diff --git
a/Debian/Dgit.pm
b/Debian/Dgit.pm
index aec5a23980ed0bb72450834df43840dd31aaf7d6..c0ee27fc4d3ca22c2e8735069ee97e440f8fb80e 100644
(file)
--- a/
Debian/Dgit.pm
+++ b/
Debian/Dgit.pm
@@
-47,7
+47,7
@@
BEGIN {
fail failmsg ensuredir must_getcwd executable_on_path
waitstatusmsg failedcmd_waitstatus
failedcmd_report_cmd failedcmd
fail failmsg ensuredir must_getcwd executable_on_path
waitstatusmsg failedcmd_waitstatus
failedcmd_report_cmd failedcmd
- runcmd cmdoutput cmdoutput_errok
+ runcmd
shell_cmd
cmdoutput cmdoutput_errok
git_rev_parse git_cat_file
git_get_ref git_get_symref git_for_each_ref
git_for_each_tag_referring is_fast_fwd
git_rev_parse git_cat_file
git_get_ref git_get_symref git_for_each_ref
git_for_each_tag_referring is_fast_fwd
@@
-315,6
+315,11
@@
sub runcmd {
failedcmd @_ if system @_;
}
failedcmd @_ if system @_;
}
+sub shell_cmd {
+ my ($first_shell, @cmd) = @_;
+ return qw(sh -ec), $first_shell.'; exec "$@"', 'x', @cmd;
+}
+
sub cmdoutput_errok {
confess Dumper(\@_)." ?" if grep { !defined } @_;
debugcmd "|",@_;
sub cmdoutput_errok {
confess Dumper(\@_)." ?" if grep { !defined } @_;
debugcmd "|",@_;