diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-20 16:28:00 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-20 16:28:00 +0100 |
commit | 0effa0aab06b3a56382729f79fbea79ae36531b8 (patch) | |
tree | bebc00030779f14fbd51f4654cbe2723294dc0e5 /Debian | |
parent | 9f4a5f045e36edddb3ffd23667a52f4ee319c675 (diff) |
Dgit.pm: Move shell_cmd from dgit
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'Debian')
-rw-r--r-- | Debian/Dgit.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index aec5a23..c0ee27f 100644 --- 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 - 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 @@ -315,6 +315,11 @@ sub runcmd { 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 "|",@_; |