cvs: SVNROOT / run-conversion.php
| From: | Gwynne Raskind | Date: | Sat, 08 Nov 2008 22:44:45 +0000 |
| Subject: | cvs: SVNROOT / run-conversion.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-54077@lists.php.net to get a copy of this message | ||
gwynne Sat Nov 8 22:44:45 2008 UTC
Modified files:
/SVNROOT run-conversion.php
Log:
redirect error output from cp, ignore permission errors in CVSROOT copy
http://cvs.php.net/viewvc.cgi/SVNROOT/run-conversion.php?r1=1.25&r2=1.26&diff_format=u
Index: SVNROOT/run-conversion.php
diff -u SVNROOT/run-conversion.php:1.25 SVNROOT/run-conversion.php:1.26
--- SVNROOT/run-conversion.php:1.25 Sat Nov 8 22:36:09 2008
+++ SVNROOT/run-conversion.php Sat Nov 8 22:44:45 2008
@@ -7,7 +7,7 @@
//
-----------------------------------------------------------------------------------------------------------------------------
// Constants
-$version = substr('$Revision: 1.25 $', strlen('$Revision: '), -2);
+$version = substr('$Revision: 1.26 $', strlen('$Revision: '), -2);
$passes = array(
'processcvs', // Process CVS modules
@@ -58,14 +58,17 @@
return array_filter($results, 'scandir_is_meta');
}
-function run_command($command)
+function run_command($command, $ignoreErrors = TRUE)
{
v(2, "Running '{$command}'...");
exec($command, $output, $exitstatus);
- if ($exitstatus != 0) {
+ if ($exitstatus != 0 && !$ignoreErrors) {
error("\nAn error occurred. Exit status was {$exitstatus}. Output:\n" .
implode("\n", $output) . "\n");
+ } else if ($exitStatus != 0) {
+ v(2, " warning: an error occurred.\n");
+ } else {
+ v(2, " done.\n");
}
- v(2, " done.\n");
return $output;
}
@@ -197,20 +200,20 @@
// We special-case php-src so we can move TSRM and ZendEngine2 into it easily. Ugh.
$command = 'exec cp -Rpv ' .
escapeshellarg($GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR .
'php-src') . ' ' .
escapeshellarg($GLOBALS['temp_path'] .
DIRECTORY_SEPARATOR . 'php-src') .
- ' > ' .
escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
+ ' 2>&1 > ' .
escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
run_command($command);
$command = 'exec cp -Rpv ' .
escapeshellarg($GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR .
'ZendEngine2') . ' ' .
escapeshellarg($GLOBALS['temp_path'] .
DIRECTORY_SEPARATOR . 'php-src') .
- ' >> ' .
escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
+ ' 2>&1 >> ' .
escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
run_command($command);
$command = 'exec cp -Rpv ' .
escapeshellarg($GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR .
'TSRM') . ' ' .
escapeshellarg($GLOBALS['temp_path'] .
DIRECTORY_SEPARATOR . 'php-src') .
- ' >> ' .
escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
+ ' 2>&1 >> ' .
escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
run_command($command);
$command = 'exec cp -Rpv ' .
escapeshellarg($GLOBALS['options']['cvsroot'] . DIRECTORY_SEPARATOR .
'CVSROOT') . ' ' .
escapeshellarg($GLOBALS['temp_path']) .
- ' >> ' .
escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
- run_command($command);
+ ' 2>&1 >> ' .
escapeshellarg($GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'cp-output');
+ run_command($command, TRUE);
$cvspath = $GLOBALS['temp_path'] . DIRECTORY_SEPARATOR .
'php-src';
}
$this->optionsFileContents .= <<<EOEXTRA