X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/37c43f74cd68c954889e0575e0b11c4074904f9c..12641c3bc3b66b6b08b7feeca89a7cc24aa0fe9c:/Porting/bisect-runner.pl diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl index 31cd290..b3963a5 100755 --- a/Porting/bisect-runner.pl +++ b/Porting/bisect-runner.pl @@ -711,6 +711,26 @@ sub system_or_die { system($command) and croak_255("'$command' failed, \$!=$!, \$?=$?"); } +sub run_with_options { + my $options = shift; + my $name = $options->{name}; + $name = "@_" unless defined $name; + + my $pid = fork; + die_255("Can't fork: $!") unless defined $pid; + if (!$pid) { + if (exists $options->{stdin}) { + open STDIN, '<', $options->{stdin} + or die "Can't open STDIN from $options->{stdin}: $!"; + } + { exec @_ }; + die_255("Failed to start $name: $!"); + } + waitpid $pid, 0 + or die_255("wait for $name, pid $pid failed: $!"); + return $?; +} + sub extract_from_file { my ($file, $rx, $default) = @_; my $fh = open_or_die($file); @@ -1139,21 +1159,13 @@ foreach my $key (sort keys %defines) { } push @ARGS, map {"-A$_"} @{$options{A}}; -# '/dev/null', name => 'Configure'}, + './Configure', @ARGS); patch_SH() unless $options{'all-fixups'}; apply_fixups($options{'late-fixup'});