svnimport: avoid open "-|" list form for Perl 5.6

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2006-02-20 14:14:15 -08:00
parent e415907d6c
commit 7ae0dc015d

View File

@ -10,7 +10,6 @@
# The head revision is on branch "origin" by default. # The head revision is on branch "origin" by default.
# You can change that with the '-o' option. # You can change that with the '-o' option.
require 5.008; # for shell-safe open("-|",LIST)
use strict; use strict;
use warnings; use warnings;
use Getopt::Std; use Getopt::Std;
@ -322,8 +321,12 @@ sub get_file($$$) {
return undef unless defined $name; return undef unless defined $name;
} }
open my $F, '-|', "git-hash-object", "-w", $name my $pid = open(my $F, '-|');
die $! unless defined $pid;
if (!$pid) {
exec("git-hash-object", "-w", $name)
or die "Cannot create object: $!\n"; or die "Cannot create object: $!\n";
}
my $sha = <$F>; my $sha = <$F>;
chomp $sha; chomp $sha;
close $F; close $F;
@ -398,7 +401,12 @@ sub copy_path($$$$$$$$) {
$srcpath =~ s#/*$#/#; $srcpath =~ s#/*$#/#;
} }
open my $f,"-|","git-ls-tree","-r","-z",$gitrev,$srcpath; my $pid = open my $f,'-|';
die $! unless defined $pid;
if (!$pid) {
exec("git-ls-tree","-r","-z",$gitrev,$srcpath)
or die $!;
}
local $/ = "\0"; local $/ = "\0";
while(<$f>) { while(<$f>) {
chomp; chomp;
@ -554,7 +562,11 @@ sub commit {
@o1 = @old; @o1 = @old;
@old = (); @old = ();
} }
open my $F, "-|", "git-ls-files", "-z", @o1 or die $!; my $pid = open my $F, "-|";
die "$!" unless defined $pid;
if (!$pid) {
exec("git-ls-files", "-z", @o1) or die $!;
}
@o1 = (); @o1 = ();
local $/ = "\0"; local $/ = "\0";
while(<$F>) { while(<$F>) {