summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8b15e2f)
raw | patch | inline | side by side (parent: 8b15e2f)
author | Eric Wong <normalperson@yhbt.net> | |
Thu, 24 Nov 2005 07:47:39 +0000 (23:47 -0800) | ||
committer | Martin Langhoff <martin@catalyst.net.nz> | |
Sun, 11 Dec 2005 01:41:39 +0000 (14:41 +1300) |
(ML: And introduce safe_pipe_capture())
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
git-archimport.perl | patch | blob | history |
diff --git a/git-archimport.perl b/git-archimport.perl
index c3bed08086d69fe3cc79b64117193a9173faa91f..b5f8a2c64b080697e34a0efea44dbbe05210a6cf 100755 (executable)
--- a/git-archimport.perl
+++ b/git-archimport.perl
my %rptags = (); # my reverse private tags
# to map a SHA1 to a commitid
+my $TLA = $ENV{'ARCH_CLIENT'} || 'tla';
foreach my $root (@arch_roots) {
my ($arepo, $abranch) = split(m!/!, $root);
|| (print Dumper(sort keys %psets)) && die "Cannot find patchset for $name";
return $ps;
}
+
+# an alterative to `command` that allows input to be passed as an array
+# to work around shell problems with weird characters in arguments
+sub safe_pipe_capture {
+ my @output;
+ if (my $pid = open my $child, '-|') {
+ @output = (<$child>);
+ close $child or die join(' ',@_).": $! $?";
+ } else {
+ exec(@_) or die $?; # exec() can fail the executable can't be found
+ }
+ return wantarray ? @output : join('',@output);
+}
+
+