From: Stig Bakken Date: Tue, 26 Nov 2002 01:32:47 +0000 (+0000) Subject: * added --ignore-errors option, --force no longer ignores errors X-Git-Tag: RELEASE_1_0b2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df158fa5cf7f8900508c28ac5ee696974a452a24;p=php * added --ignore-errors option, --force no longer ignores errors --- diff --git a/pear/PEAR/Command/Install.php b/pear/PEAR/Command/Install.php index 69256a9f56..61014ede0e 100644 --- a/pear/PEAR/Command/Install.php +++ b/pear/PEAR/Command/Install.php @@ -66,6 +66,9 @@ class PEAR_Command_Install extends PEAR_Command_Common 'arg' => 'DIR', 'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT)', ), + 'ignore-errors' => array( + 'doc' => 'force install even if there were errors', + ), ), 'doc' => ' ... Installs one or more PEAR packages. You can specify a package to @@ -117,6 +120,9 @@ four ways of specifying packages. 'arg' => 'DIR', 'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT)', ), + 'ignore-errors' => array( + 'doc' => 'force install even if there were errors', + ), ), 'doc' => ' ... Upgrades one or more PEAR packages. See documentation for the @@ -154,6 +160,9 @@ More than one package may be specified at once. 'arg' => 'DIR', 'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT)', ), + 'ignore-errors' => array( + 'doc' => 'force install even if there were errors', + ), ), 'doc' => ' Upgrades all packages that have a newer release available. Upgrades are @@ -179,6 +188,9 @@ more stable. 'arg' => 'DIR', 'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT)', ), + 'ignore-errors' => array( + 'doc' => 'force install even if there were errors', + ), ), 'doc' => ' ... Uninstalls one or more PEAR packages. More than one package may be diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 21d7bf9235..0501194cd7 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -220,8 +220,8 @@ class PEAR_Installer extends PEAR_Common $this->log(3, "+ mkdir $dest_dir"); } if (empty($atts['replacements'])) { - if (!copy($orig_file, $dest_file)) { - return $this->raiseError("failed to copy $orig_file to $dest_file", + if (!@copy($orig_file, $dest_file)) { + return $this->raiseError("failed to write $dest_file", PEAR_INSTALLER_FAILED); } $this->log(3, "+ cp $orig_file $dest_file"); @@ -684,7 +684,7 @@ class PEAR_Installer extends PEAR_Common $res = $this->_installFile($file, $atts, $tmp_path); $this->popExpect(); if (PEAR::isError($res)) { - if (empty($options['force'])) { + if (empty($options['ignore-errors'])) { $this->rollbackFileTransaction(); return $this->raiseError($res); } else { diff --git a/pear/package-PEAR.xml b/pear/package-PEAR.xml index 13fcbb56f3..98628294b9 100644 --- a/pear/package-PEAR.xml +++ b/pear/package-PEAR.xml @@ -35,9 +35,12 @@ stable 2002-11-11 -New Features, Installer: -* installer aborts failed installs nicely (using - file "transactions") +Changes, Installer: +* --force option no longer ignores errors, use + --ignore-errors instead +* installer transactions: failed installs abort + cleanly, without leaving half-installed packages + around