installto.sh: Fix false reporting of failed upgrade (#6019)

system() returns the last line of output (or false on failure)
rsync will have no output if the file being copied hasn't changed

Signed-off-by: Nathan Rennie-Waldock <nathan.renniewaldock@gmail.com>
pull/6072/head
Nathan Rennie-Waldock 7 years ago committed by Aleksander Machniak
parent a9170f652c
commit 2242506523

@ -61,13 +61,13 @@ if (strtolower($input) == 'y') {
// @FIXME: should we use --delete for all directories?
$delete = in_array($dir, array('program', 'installer', 'vendor')) ? '--delete ' : '';
$command = "rsync -aC --out-format=%n " . $delete . INSTALL_PATH . "$dir/ $target_dir/$dir/";
if (!system($command, $ret) || $ret > 0) {
if (system($command, $ret) === false || $ret > 0) {
rcube::raise_error("Failed to execute command: $command", false, true);
}
}
foreach (array('index.php','.htaccess','config/defaults.inc.php','composer.json-dist','jsdeps.json','CHANGELOG','README.md','UPGRADING','LICENSE','INSTALL') as $file) {
$command = "rsync -a --out-format=%n " . INSTALL_PATH . "$file $target_dir/$file";
if (file_exists(INSTALL_PATH . $file) && (!system($command, $ret) || $ret > 0)) {
if (file_exists(INSTALL_PATH . $file) && (system($command, $ret) === false || $ret > 0)) {
rcube::raise_error("Failed to execute command: $command", false, true);
}
}

Loading…
Cancel
Save