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 "") { if ($upgrade{$upgrade}{pl} ne "") {
my $cmd = $perl." ".$upgrade{$upgrade}{pl}." --configFile=".$filename; my $pid = fork;
$cmd .= " --quiet" if ($quiet); if (!$pid) {
if (system($cmd)) { @ARGV = ("--configFile=$filename", $quiet ? ('--quiet') : ());
print "\tProcessing upgrade executable failed!\n"; $0 = $upgrade{$upgrade}{pl};
fatalError(); do $0;
} exit;
}
waitpid $pid, 0;
if ($?) {
print "\tProcessing upgrade executable failed!\n";
fatalError();
}
} }
$config{$filename}{version} = $upgrade{$upgrade}{to}; $config{$filename}{version} = $upgrade{$upgrade}{to};
$notRun = 0; $notRun = 0;