Skip to content

Commit

Permalink
* added --ignore-errors option, --force no longer ignores errors
Browse files Browse the repository at this point in the history
  • Loading branch information
stigsb committed Nov 26, 2002
1 parent 58c57d4 commit df158fa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
12 changes: 12 additions & 0 deletions pear/PEAR/Command/Install.php
Expand Up @@ -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' => '<package> ...
Installs one or more PEAR packages. You can specify a package to
Expand Down Expand Up @@ -117,6 +120,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' => '<package> ...
Upgrades one or more PEAR packages. See documentation for the
Expand Down Expand Up @@ -154,6 +160,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' => '
Upgrades all packages that have a newer release available. Upgrades are
Expand All @@ -179,6 +188,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' => '<package> ...
Uninstalls one or more PEAR packages. More than one package may be
Expand Down
6 changes: 3 additions & 3 deletions pear/PEAR/Installer.php
Expand Up @@ -220,8 +220,8 @@ function _installFile($file, $atts, $tmp_path)
$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");
Expand Down Expand Up @@ -684,7 +684,7 @@ function install($pkgfile, $options = array())
$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 {
Expand Down
9 changes: 6 additions & 3 deletions pear/package-PEAR.xml
Expand Up @@ -35,9 +35,12 @@
<state>stable</state>
<date>2002-11-11</date>
<notes>
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
</notes>
<filelist>
<file role="data" name="package.dtd"/>
Expand Down

0 comments on commit df158fa

Please sign in to comment.