process upgrade scripts in forks to carry over -I includes and anything else

This commit is contained in:
Graham Knop 2008-09-15 21:51:41 +00:00
parent 9940ceb7c7
commit 6278278508

View file

@ -226,12 +226,18 @@ foreach my $filename (keys %config) {
}
}
if ($upgrade{$upgrade}{pl} ne "") {
my $cmd = $perl." ".$upgrade{$upgrade}{pl}." --configFile=".$filename;
$cmd .= " --quiet" if ($quiet);
if (system($cmd)) {
print "\tProcessing upgrade executable failed!\n";
fatalError();
}
my $pid = fork;
if (!$pid) {
@ARGV = ("--configFile=$filename", $quiet ? ('--quiet') : ());
$0 = $upgrade{$upgrade}{pl};
do $0;
exit;
}
waitpid $pid, 0;
if ($?) {
print "\tProcessing upgrade executable failed!\n";
fatalError();
}
}
$config{$filename}{version} = $upgrade{$upgrade}{to};
$notRun = 0;