Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
archimport: first, make sure it still compiles
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>
git-archimport.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
8b15e2f
)
diff --git
a/git-archimport.perl
b/git-archimport.perl
index c3bed08086d69fe3cc79b64117193a9173faa91f..b5f8a2c64b080697e34a0efea44dbbe05210a6cf 100755
(executable)
--- a/
git-archimport.perl
+++ b/
git-archimport.perl
@@
-99,6
+99,7
@@
END
my %rptags = (); # my reverse private tags
# to map a SHA1 to a commitid
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);
foreach my $root (@arch_roots) {
my ($arepo, $abranch) = split(m!/!, $root);
@@
-850,3
+851,18
@@
sub commitid2pset {
|| (print Dumper(sort keys %psets)) && die "Cannot find patchset for $name";
return $ps;
}
|| (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);
+}
+
+