summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2002-05-21 09:19:46 +0000
committerTomas V.V.Cox <cox@php.net>2002-05-21 09:19:46 +0000
commit743ad318843709ee56abca776bcc8c29e60b1ea5 (patch)
tree638414d3c168e77d0471eb5d07c992ae3f4dedf6
parentd8d42fcc592690ced67eef506c89a5a4e7e860eb (diff)
downloadphp-git-743ad318843709ee56abca776bcc8c29e60b1ea5.tar.gz
files that are not installed should be removed from the
registered file list (TODO--)
-rw-r--r--pear/PEAR/Installer.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php
index 1426097bba..86bf72f44e 100644
--- a/pear/PEAR/Installer.php
+++ b/pear/PEAR/Installer.php
@@ -23,10 +23,6 @@ require_once 'PEAR/Common.php';
require_once 'PEAR/Registry.php';
require_once 'PEAR/Dependency.php';
-// TODO:
-// * files that are not installed should be removed from the
-// registered file list.
-
/**
* Administration class used to install PEAR packages and maintain the
* installed package database.
@@ -427,7 +423,7 @@ class PEAR_Installer extends PEAR_Common
// Copy files to dest dir ---------------------------------------
// info from the package it self we want to access from _installFile
- $this->pkginfo = $pkginfo;
+ $this->pkginfo = &$pkginfo;
if (empty($options['register-only'])) {
if (!is_dir($this->config->get('php_dir'))) {
return $this->raiseError("no script destination directory\n",
@@ -450,8 +446,13 @@ class PEAR_Installer extends PEAR_Common
foreach ($pkginfo['filelist'] as $file => $atts) {
$res = $this->_installFile($file, $atts, $tmp_path);
- if (!$res && empty($options['force'])) {
- return null;
+ if (!$res) {
+ // If file can't be installed and 'force' is not set, abort
+ if (empty($options['force'])) {
+ return null;
+ }
+ // Do not register not installed files
+ unset($pkginfo['filelist'][$file]);
}
}
}
@@ -462,9 +463,9 @@ class PEAR_Installer extends PEAR_Common
if (!empty($options['force']) && $this->registry->packageExists($pkgname)) {
$this->registry->deletePackage($pkgname);
}
- $ret = $this->registry->addPackage($pkgname, $this->pkginfo);
+ $ret = $this->registry->addPackage($pkgname, $pkginfo);
} else {
- $ret = $this->registry->updatePackage($pkgname, $this->pkginfo, false);
+ $ret = $this->registry->updatePackage($pkgname, $pkginfo, false);
}
if (!$ret) {
return null;