mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
files that are not installed should be removed from the
registered file list (TODO--)
This commit is contained in:
parent
d8d42fcc59
commit
743ad31884
1 changed files with 10 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue