summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2013-09-12 00:09:25 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2013-09-12 00:09:25 +0100
commit66594ad255963a63ee55caa88ce5fa3a2b5954a1 (patch)
treeabbc81989fc325b37b57833e403f17c1e02c8e3d
parent8d37038bddb78dbe6dcf1c1e2bc515c1dcd7002c (diff)
break out shell_cmd
-rwxr-xr-xdgit8
1 files changed, 6 insertions, 2 deletions
diff --git a/dgit b/dgit
index f77d349..9768fe9 100755
--- a/dgit
+++ b/dgit
@@ -209,6 +209,11 @@ sub runcmd_ordryrun {
}
}
+sub shell_cmd {
+ my ($first_shell, @cmd) = @_;
+ return qw(sh -ec), $first_shell.'; exec "$@"', 'x', @cmd;
+}
+
our $helpmsg = <<END;
main usages:
dgit [dgit-opts] clone [dgit-opts] package [suite] [./dir|/dir]
@@ -660,8 +665,7 @@ sub ensure_we_have_orig () {
$origurl .= "/$f";
die "$f ?" unless $f =~ m/^${package}_/;
die "$f ?" if $f =~ m#/#;
- runcmd_ordryrun qw(sh -ec),'cd ..; exec "$@"','x',
- @dget,'--',$origurl;
+ runcmd_ordryrun shell_cmd 'cd ..', @dget,'--',$origurl;
}
}