[PATCH 1/9] archimport: first, make sure it still compiles
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Nov 24, 2005, 07:47 UTC
- Message-ID
- <20051124074739.GB4789@mail.yhbt.net>
- In-Reply-To
- <20051124074605.GA4789@mail.yhbt.net>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-archimport.perl | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
applies-to: a17c1f442587b9c7d68b4f7e08c5f6786599c61e 119b07aa2bdb23d5f4977c4d696dd5e7eea56ca6
diff --git a/git-archimport.perl b/git-archimport.perl index c3bed08..b5f8a2c 100755 --- a/git-archimport.perl +++ b/git-archimport.perl @@ -99,6 +99,7 @@ my %psets = (); # the co 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); @@ -850,3 +851,18 @@ sub commitid2pset { || (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); +} + + --- 0.99.9.GIT
-- Eric Wong