cvs: pear-core /PEAR Dependency2.php DependencyDB.php Downloader.php Installer.php Registry.php /PEAR/Command Install.php
/PEAR/PackageFile/Generator v1.php
| From: | Greg Beaver | Date: | Tue, 16 Nov 2004 05:31:32 +0000 |
| Subject: | cvs: pear-core /PEAR Dependency2.php DependencyDB.php Downloader.php Installer.php Registry.php /PEAR/Command Install.php /PEAR/PackageFile/Generator v1.php |
||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-26003@lists.php.net to get a copy of this message | ||
cellog Tue Nov 16 00:31:32 2004 EDT
Modified files:
/pear-core/PEAR/Command Install.php
/pear-core/PEAR Dependency2.php DependencyDB.php Downloader.php
Installer.php Registry.php
/pear-core/PEAR/PackageFile/Generator v1.php
Log:
fix serious bug when downloading multiple packages to install
fix bugs found in unit-testing dependencyDB
fine-tune versioning in DependencyDB
fix warnings in Generator_v1->toV2() caused by stupid older versions
of PEAR installer, things like
<dep type="php" rel="ge" name="4.0.6"/>
and other gems from the past.
http://cvs.php.net/diff.php/pear-core/PEAR/Command/Install.php?r1=1.69&r2=1.70&ty=u Index: pear-core/PEAR/Command/Install.php diff -u pear-core/PEAR/Command/Install.php:1.69 pear-core/PEAR/Command/Install.php:1.70 --- pear-core/PEAR/Command/Install.php:1.69 Sun Oct 31 14:27:39 2004 +++ pear-core/PEAR/Command/Install.php Tue Nov 16 00:31:29 2004 @@ -16,7 +16,7 @@ // | Author: Stig Sæther Bakken <ssb@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Install.php,v 1.69 2004/10/31 19:27:39 cellog Exp $ +// $Id: Install.php,v 1.70 2004/11/16 05:31:29 cellog Exp $ require_once "PEAR/Command/Common.php"; require_once "PEAR/Installer.php"; @@ -478,7 +478,11 @@ } } } - $this->installer->sortPackagesForUninstall($newparams); + $err = $this->installer->sortPackagesForUninstall($newparams); + if (PEAR::isError($err)) { + $this->ui->outputData($err->getMessage(), $command); + return true; + } $params = $newparams; // twist this to use it to check on whether dependent packages are also being uninstalled // for circular dependencies like subpackages @@ -500,14 +504,16 @@ $this->ui->outputData("uninstall ok: $pkg", $command); } if (is_object($savepkg)) { - PEAR::pushErrorHandling(PEAR_ERROR_RETURN); - $info = $this->installer->ftpUninstall($savepkg); - PEAR::popErrorHandling(); - if (PEAR::isError($info)) { - $this->ui->outputData($info->getMessage()); - $this->ui->outputData("remote uninstall failed: $pkg"); - } else { - $this->ui->outputData("remote uninstall ok: $pkg"); + if ($this->config->isDefinedLayer('ftp')) { + $this->installer->pushErrorHandling(PEAR_ERROR_RETURN); + $info = $this->installer->ftpUninstall($savepkg); + $this->installer->popErrorHandling(); + if (PEAR::isError($info)) { + $this->ui->outputData($info->getMessage()); + $this->ui->outputData("remote uninstall failed: $pkg"); + } else { + $this->ui->outputData("remote uninstall ok: $pkg"); + } } } } else { http://cvs.php.net/diff.php/pear-core/PEAR/Dependency2.php?r1=1.25&r2=1.26&ty=u Index: pear-core/PEAR/Dependency2.php diff -u pear-core/PEAR/Dependency2.php:1.25 pear-core/PEAR/Dependency2.php:1.26 --- pear-core/PEAR/Dependency2.php:1.25 Thu Oct 21 18:23:19 2004 +++ pear-core/PEAR/Dependency2.php Tue Nov 16 00:31:31 2004 @@ -16,7 +16,7 @@ // | Authors: Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Dependency2.php,v 1.25 2004/10/21 22:23:19 cellog Exp $ +// $Id: Dependency2.php,v 1.26 2004/11/16 05:31:31 cellog Exp $ require_once 'OS/Guess.php'; require_once 'PEAR/Validate.php'; @@ -751,6 +751,9 @@ function validatePackageUninstall(&$dl) { + if (PEAR::isError($this->_dependencydb)) { + return $this->_dependencydb; + } $params = array(); // construct an array of "downloaded" packages to fool the package dependency checker // into using these to validate uninstalls of circular dependencies http://cvs.php.net/diff.php/pear-core/PEAR/DependencyDB.php?r1=1.12&r2=1.13&ty=u Index: pear-core/PEAR/DependencyDB.php diff -u pear-core/PEAR/DependencyDB.php:1.12 pear-core/PEAR/DependencyDB.php:1.13 --- pear-core/PEAR/DependencyDB.php:1.12 Thu Oct 21 18:23:19 2004 +++ pear-core/PEAR/DependencyDB.php Tue Nov 16 00:31:31 2004 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: DependencyDB.php,v 1.12 2004/10/21 22:23:19 cellog Exp $ +// $Id: DependencyDB.php,v 1.13 2004/11/16 05:31:31 cellog Exp $ require_once 'PEAR.php'; require_once 'PEAR/Registry.php'; @@ -42,7 +42,7 @@ /** * @param string * @param PEAR_Config - * @return PEAR_DependencyDB + * @return PEAR_DependencyDB|PEAR_Error * @static */ function &singleton(&$config, $depdb = false) @@ -50,12 +50,14 @@ if (!isset($GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'])) { $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'] = new PEAR_DependencyDB; $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE']->setConfig($config, $depdb); - $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE']->assertDepsDB(); + if (PEAR::isError($e = $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE']->assertDepsDB())) { + return $e; + } } return $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE']; } - function setConfig(&$config, $depdb) + function setConfig(&$config, $depdb = false) { if (!$config) { $this->_config = &PEAR_Config::singleton(); @@ -81,9 +83,14 @@ } else { $depdb = $this->_getDepDB(); // Datatype format has been changed, rebuild the Deps DB - if ($depdb['_version'] != $this->_version) { + if ($depdb['_version'] < $this->_version) { $this->rebuildDB(); } + if ($depdb['_version']{0} > $this->_version{0}) { + return PEAR::raiseError('Dependency database is version ' . + $depdb['_version'] . ', and we are version ' . + $this->_version . ', cannot continue'); + } } } @@ -132,7 +139,8 @@ foreach ($depend as $info) { $temp = $this->getDependencies($info); foreach ($temp as $dep) { - if ($dep['dep']['channel'] == $channel && $dep['dep']['name'] == $package) { + if (strtolower($dep['dep']['channel']) == strtolower($channel) && + strtolower($dep['dep']['name']) == strtolower($package)) { $dependencies[$info['channel']][$info['package']] = $dep; } } @@ -161,6 +169,8 @@ /** * Determine whether $parent depends on $child, near or deep + * @param array|PEAR_PackageFile_v2|PEAR_PackageFile_v2 + * @param array|PEAR_PackageFile_v2|PEAR_PackageFile_v2 */ function dependsOn($parent, $child) { @@ -178,10 +188,6 @@ $channel = strtolower($parent['channel']); $package = strtolower($parent['package']); } - if (isset($checked[$channel][$package])) { - return false; // avoid endless recursion - } - $checked[$channel][$package] = true; if (is_object($child)) { $depchannel = strtolower($child->getChannel()); $deppackage = strtolower($child->getPackage()); @@ -189,12 +195,16 @@ $depchannel = strtolower($child['channel']); $deppackage = strtolower($child['package']); } + if (isset($checked[$channel][$package][$depchannel][$deppackage])) { + return false; // avoid endless recursion + } + $checked[$channel][$package][$depchannel][$deppackage] = true; if (!isset($this->_cache['dependencies'][$channel][$package])) { return false; } foreach ($this->_cache['dependencies'][$channel][$package] as $info) { - if ($info['dep']['channel'] == $depchannel && - $info['dep']['name'] == $deppackage) { + if (strtolower($info['dep']['channel']) == strtolower($depchannel) && + strtolower($info['dep']['name']) == strtolower($deppackage)) { return true; } } http://cvs.php.net/diff.php/pear-core/PEAR/Downloader.php?r1=1.45&r2=1.46&ty=u Index: pear-core/PEAR/Downloader.php diff -u pear-core/PEAR/Downloader.php:1.45 pear-core/PEAR/Downloader.php:1.46 --- pear-core/PEAR/Downloader.php:1.45 Mon Nov 15 17:50:26 2004 +++ pear-core/PEAR/Downloader.php Tue Nov 16 00:31:31 2004 @@ -19,7 +19,7 @@ // | Martin Jansen <mj@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Downloader.php,v 1.45 2004/11/15 22:50:26 cellog Exp $ +// $Id: Downloader.php,v 1.46 2004/11/16 05:31:31 cellog Exp $ require_once 'PEAR/Common.php'; require_once 'PEAR/Registry.php'; @@ -274,8 +274,8 @@ $params[$i]->detectDependencies($params); } } - while (call_user_func(array($this->getDownloaderPackageClass(), 'mergeDependencies'), - $params)); + while (call_user_func_array(array($this->getDownloaderPackageClass(), 'mergeDependencies'), + array(&$params))); call_user_func_array(array($this->getDownloaderPackageClass(), 'removeInstalled'), array(&$params)); if (!count($params)) { @@ -290,9 +290,9 @@ } $ret = array(); $newparams = array(); - foreach ($params as $package) { + foreach ($params as $i => $package) { PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); - $pf = &$package->download(); + $pf = &$params[$i]->download(); PEAR::staticPopErrorHandling(); if (PEAR::isError($pf)) { $this->log(1, $pf->getMessage()); @@ -301,7 +301,7 @@ '"'); continue; } - $newparams[] = &$package; + $newparams[] = &$params[$i]; $ret[] = array('file' => $pf->getArchiveFile(), 'info' => &$pf, 'pkg' => $pf->getPackage()); http://cvs.php.net/diff.php/pear-core/PEAR/Installer.php?r1=1.173&r2=1.174&ty=u Index: pear-core/PEAR/Installer.php diff -u pear-core/PEAR/Installer.php:1.173 pear-core/PEAR/Installer.php:1.174 --- pear-core/PEAR/Installer.php:1.173 Thu Nov 4 14:10:32 2004 +++ pear-core/PEAR/Installer.php Tue Nov 16 00:31:31 2004 @@ -19,7 +19,7 @@ // | Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Installer.php,v 1.173 2004/11/04 19:10:32 cellog Exp $ +// $Id: Installer.php,v 1.174 2004/11/16 05:31:31 cellog Exp $ require_once 'PEAR/Downloader.php'; require_once 'PEAR/Task/Common.php'; @@ -1114,7 +1114,7 @@ { $ftp = &$this->config->getFTP(); if (!$ftp) { - return PEAR::raiseError('FTP client not initialized'); + return $this->raiseError('FTP client not initialized'); } $this->log(2, 'Connect to FTP server'); $e = $ftp->init(); @@ -1425,11 +1425,14 @@ * * It also removes duplicate dependencies * @param array an array of PEAR_PackageFile_v[1/2] objects - * @return array array of array(packagefilename, package.xml contents) + * @return array|PEAR_Error array of array(packagefilename, package.xml contents) */ function sortPackagesForUninstall(&$packages) { $this->_dependencyDB = PEAR_DependencyDB::singleton($this->config); + if (PEAR::isError($this->_dependencyDB)) { + return $this->_dependencyDB; + } usort($packages, array(&$this, '_sortUninstall')); } http://cvs.php.net/diff.php/pear-core/PEAR/Registry.php?r1=1.82&r2=1.83&ty=u Index: pear-core/PEAR/Registry.php diff -u pear-core/PEAR/Registry.php:1.82 pear-core/PEAR/Registry.php:1.83 --- pear-core/PEAR/Registry.php:1.82 Mon Nov 15 13:12:25 2004 +++ pear-core/PEAR/Registry.php Tue Nov 16 00:31:31 2004 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Registry.php,v 1.82 2004/11/15 18:12:25 cellog Exp $ +// $Id: Registry.php,v 1.83 2004/11/16 05:31:31 cellog Exp $ /* TODO: @@ -191,6 +191,16 @@ if (!$initializing) { $initializing = true; $this->_dependencyDB = &PEAR_DependencyDB::singleton($this->_config); + if (PEAR::isError($this->_dependencyDB)) { + // attempt to recover by removing the dep db + @unlink($this->_config->get('php_dir', null, 'pear.php.net') . + DIRECTORY_SEPARATOR . '.depdb'); + $this->_dependencyDB = &PEAR_DependencyDB::singleton($this->_config); + if (PEAR::isError($this->_dependencyDB)) { + echo $this->_dependencyDB->getMessage(); + die('Unrecoverable error'); + } + } $initializing = false; } } http://cvs.php.net/diff.php/pear-core/PEAR/PackageFile/Generator/v1.php?r1=1.15&r2=1.16&ty=u Index: pear-core/PEAR/PackageFile/Generator/v1.php diff -u pear-core/PEAR/PackageFile/Generator/v1.php:1.15 pear-core/PEAR/PackageFile/Generator/v1.php:1.16 --- pear-core/PEAR/PackageFile/Generator/v1.php:1.15 Wed Nov 3 23:15:48 2004 +++ pear-core/PEAR/PackageFile/Generator/v1.php Tue Nov 16 00:31:31 2004 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: v1.php,v 1.15 2004/11/04 04:15:48 cellog Exp $ +// $Id: v1.php,v 1.16 2004/11/16 05:31:31 cellog Exp $ require_once 'PEAR/Validate.php'; /** * This class converts a PEAR_PackageFile_v1 object into any output format. @@ -624,6 +624,10 @@ if (count($deps['php']) > 1) { $php = $this->_processMultipleDeps($deps['php']); } else { + if (!isset($deps['php'][0])) { + list($key, $blah) = each ($deps['php']); // stupid buggy versions + $deps['php'] = array($blah[0]); + } $php = $this->_processDep($deps['php'][0]); if (!$php) { break; // poor mans throw @@ -781,6 +785,13 @@ $php['exclude'] = $dep['version']; break; case 'ge' : + if (!isset($dep['version'])) { + if ($dep['type'] == 'php') { + if (isset($dep['name'])) { + $dep['version'] = $dep['name']; + } + } + } $php['min'] = $dep['version']; break; case 'lt' :
http://cvs.php.net/diff.php/pear-core/PEAR/Command/Install.php?r1=1.69&r2=1.70&ty=u Index: pear-core/PEAR/Command/Install.php diff -u pear-core/PEAR/Command/Install.php:1.69 pear-core/PEAR/Command/Install.php:1.70 --- pear-core/PEAR/Command/Install.php:1.69 Sun Oct 31 14:27:39 2004 +++ pear-core/PEAR/Command/Install.php Tue Nov 16 00:31:29 2004 @@ -16,7 +16,7 @@ // | Author: Stig Sæther Bakken <ssb@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Install.php,v 1.69 2004/10/31 19:27:39 cellog Exp $ +// $Id: Install.php,v 1.70 2004/11/16 05:31:29 cellog Exp $ require_once "PEAR/Command/Common.php"; require_once "PEAR/Installer.php"; @@ -478,7 +478,11 @@ } } } - $this->installer->sortPackagesForUninstall($newparams); + $err = $this->installer->sortPackagesForUninstall($newparams); + if (PEAR::isError($err)) { + $this->ui->outputData($err->getMessage(), $command); + return true; + } $params = $newparams; // twist this to use it to check on whether dependent packages are also being uninstalled // for circular dependencies like subpackages @@ -500,14 +504,16 @@ $this->ui->outputData("uninstall ok: $pkg", $command); } if (is_object($savepkg)) { - PEAR::pushErrorHandling(PEAR_ERROR_RETURN); - $info = $this->installer->ftpUninstall($savepkg); - PEAR::popErrorHandling(); - if (PEAR::isError($info)) { - $this->ui->outputData($info->getMessage()); - $this->ui->outputData("remote uninstall failed: $pkg"); - } else { - $this->ui->outputData("remote uninstall ok: $pkg"); + if ($this->config->isDefinedLayer('ftp')) { + $this->installer->pushErrorHandling(PEAR_ERROR_RETURN); + $info = $this->installer->ftpUninstall($savepkg); + $this->installer->popErrorHandling(); + if (PEAR::isError($info)) { + $this->ui->outputData($info->getMessage()); + $this->ui->outputData("remote uninstall failed: $pkg"); + } else { + $this->ui->outputData("remote uninstall ok: $pkg"); + } } } } else { http://cvs.php.net/diff.php/pear-core/PEAR/Dependency2.php?r1=1.25&r2=1.26&ty=u Index: pear-core/PEAR/Dependency2.php diff -u pear-core/PEAR/Dependency2.php:1.25 pear-core/PEAR/Dependency2.php:1.26 --- pear-core/PEAR/Dependency2.php:1.25 Thu Oct 21 18:23:19 2004 +++ pear-core/PEAR/Dependency2.php Tue Nov 16 00:31:31 2004 @@ -16,7 +16,7 @@ // | Authors: Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Dependency2.php,v 1.25 2004/10/21 22:23:19 cellog Exp $ +// $Id: Dependency2.php,v 1.26 2004/11/16 05:31:31 cellog Exp $ require_once 'OS/Guess.php'; require_once 'PEAR/Validate.php'; @@ -751,6 +751,9 @@ function validatePackageUninstall(&$dl) { + if (PEAR::isError($this->_dependencydb)) { + return $this->_dependencydb; + } $params = array(); // construct an array of "downloaded" packages to fool the package dependency checker // into using these to validate uninstalls of circular dependencies http://cvs.php.net/diff.php/pear-core/PEAR/DependencyDB.php?r1=1.12&r2=1.13&ty=u Index: pear-core/PEAR/DependencyDB.php diff -u pear-core/PEAR/DependencyDB.php:1.12 pear-core/PEAR/DependencyDB.php:1.13 --- pear-core/PEAR/DependencyDB.php:1.12 Thu Oct 21 18:23:19 2004 +++ pear-core/PEAR/DependencyDB.php Tue Nov 16 00:31:31 2004 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: DependencyDB.php,v 1.12 2004/10/21 22:23:19 cellog Exp $ +// $Id: DependencyDB.php,v 1.13 2004/11/16 05:31:31 cellog Exp $ require_once 'PEAR.php'; require_once 'PEAR/Registry.php'; @@ -42,7 +42,7 @@ /** * @param string * @param PEAR_Config - * @return PEAR_DependencyDB + * @return PEAR_DependencyDB|PEAR_Error * @static */ function &singleton(&$config, $depdb = false) @@ -50,12 +50,14 @@ if (!isset($GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'])) { $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'] = new PEAR_DependencyDB; $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE']->setConfig($config, $depdb); - $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE']->assertDepsDB(); + if (PEAR::isError($e = $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE']->assertDepsDB())) { + return $e; + } } return $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE']; } - function setConfig(&$config, $depdb) + function setConfig(&$config, $depdb = false) { if (!$config) { $this->_config = &PEAR_Config::singleton(); @@ -81,9 +83,14 @@ } else { $depdb = $this->_getDepDB(); // Datatype format has been changed, rebuild the Deps DB - if ($depdb['_version'] != $this->_version) { + if ($depdb['_version'] < $this->_version) { $this->rebuildDB(); } + if ($depdb['_version']{0} > $this->_version{0}) { + return PEAR::raiseError('Dependency database is version ' . + $depdb['_version'] . ', and we are version ' . + $this->_version . ', cannot continue'); + } } } @@ -132,7 +139,8 @@ foreach ($depend as $info) { $temp = $this->getDependencies($info); foreach ($temp as $dep) { - if ($dep['dep']['channel'] == $channel && $dep['dep']['name'] == $package) { + if (strtolower($dep['dep']['channel']) == strtolower($channel) && + strtolower($dep['dep']['name']) == strtolower($package)) { $dependencies[$info['channel']][$info['package']] = $dep; } } @@ -161,6 +169,8 @@ /** * Determine whether $parent depends on $child, near or deep + * @param array|PEAR_PackageFile_v2|PEAR_PackageFile_v2 + * @param array|PEAR_PackageFile_v2|PEAR_PackageFile_v2 */ function dependsOn($parent, $child) { @@ -178,10 +188,6 @@ $channel = strtolower($parent['channel']); $package = strtolower($parent['package']); } - if (isset($checked[$channel][$package])) { - return false; // avoid endless recursion - } - $checked[$channel][$package] = true; if (is_object($child)) { $depchannel = strtolower($child->getChannel()); $deppackage = strtolower($child->getPackage()); @@ -189,12 +195,16 @@ $depchannel = strtolower($child['channel']); $deppackage = strtolower($child['package']); } + if (isset($checked[$channel][$package][$depchannel][$deppackage])) { + return false; // avoid endless recursion + } + $checked[$channel][$package][$depchannel][$deppackage] = true; if (!isset($this->_cache['dependencies'][$channel][$package])) { return false; } foreach ($this->_cache['dependencies'][$channel][$package] as $info) { - if ($info['dep']['channel'] == $depchannel && - $info['dep']['name'] == $deppackage) { + if (strtolower($info['dep']['channel']) == strtolower($depchannel) && + strtolower($info['dep']['name']) == strtolower($deppackage)) { return true; } } http://cvs.php.net/diff.php/pear-core/PEAR/Downloader.php?r1=1.45&r2=1.46&ty=u Index: pear-core/PEAR/Downloader.php diff -u pear-core/PEAR/Downloader.php:1.45 pear-core/PEAR/Downloader.php:1.46 --- pear-core/PEAR/Downloader.php:1.45 Mon Nov 15 17:50:26 2004 +++ pear-core/PEAR/Downloader.php Tue Nov 16 00:31:31 2004 @@ -19,7 +19,7 @@ // | Martin Jansen <mj@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Downloader.php,v 1.45 2004/11/15 22:50:26 cellog Exp $ +// $Id: Downloader.php,v 1.46 2004/11/16 05:31:31 cellog Exp $ require_once 'PEAR/Common.php'; require_once 'PEAR/Registry.php'; @@ -274,8 +274,8 @@ $params[$i]->detectDependencies($params); } } - while (call_user_func(array($this->getDownloaderPackageClass(), 'mergeDependencies'), - $params)); + while (call_user_func_array(array($this->getDownloaderPackageClass(), 'mergeDependencies'), + array(&$params))); call_user_func_array(array($this->getDownloaderPackageClass(), 'removeInstalled'), array(&$params)); if (!count($params)) { @@ -290,9 +290,9 @@ } $ret = array(); $newparams = array(); - foreach ($params as $package) { + foreach ($params as $i => $package) { PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); - $pf = &$package->download(); + $pf = &$params[$i]->download(); PEAR::staticPopErrorHandling(); if (PEAR::isError($pf)) { $this->log(1, $pf->getMessage()); @@ -301,7 +301,7 @@ '"'); continue; } - $newparams[] = &$package; + $newparams[] = &$params[$i]; $ret[] = array('file' => $pf->getArchiveFile(), 'info' => &$pf, 'pkg' => $pf->getPackage()); http://cvs.php.net/diff.php/pear-core/PEAR/Installer.php?r1=1.173&r2=1.174&ty=u Index: pear-core/PEAR/Installer.php diff -u pear-core/PEAR/Installer.php:1.173 pear-core/PEAR/Installer.php:1.174 --- pear-core/PEAR/Installer.php:1.173 Thu Nov 4 14:10:32 2004 +++ pear-core/PEAR/Installer.php Tue Nov 16 00:31:31 2004 @@ -19,7 +19,7 @@ // | Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Installer.php,v 1.173 2004/11/04 19:10:32 cellog Exp $ +// $Id: Installer.php,v 1.174 2004/11/16 05:31:31 cellog Exp $ require_once 'PEAR/Downloader.php'; require_once 'PEAR/Task/Common.php'; @@ -1114,7 +1114,7 @@ { $ftp = &$this->config->getFTP(); if (!$ftp) { - return PEAR::raiseError('FTP client not initialized'); + return $this->raiseError('FTP client not initialized'); } $this->log(2, 'Connect to FTP server'); $e = $ftp->init(); @@ -1425,11 +1425,14 @@ * * It also removes duplicate dependencies * @param array an array of PEAR_PackageFile_v[1/2] objects - * @return array array of array(packagefilename, package.xml contents) + * @return array|PEAR_Error array of array(packagefilename, package.xml contents) */ function sortPackagesForUninstall(&$packages) { $this->_dependencyDB = PEAR_DependencyDB::singleton($this->config); + if (PEAR::isError($this->_dependencyDB)) { + return $this->_dependencyDB; + } usort($packages, array(&$this, '_sortUninstall')); } http://cvs.php.net/diff.php/pear-core/PEAR/Registry.php?r1=1.82&r2=1.83&ty=u Index: pear-core/PEAR/Registry.php diff -u pear-core/PEAR/Registry.php:1.82 pear-core/PEAR/Registry.php:1.83 --- pear-core/PEAR/Registry.php:1.82 Mon Nov 15 13:12:25 2004 +++ pear-core/PEAR/Registry.php Tue Nov 16 00:31:31 2004 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Registry.php,v 1.82 2004/11/15 18:12:25 cellog Exp $ +// $Id: Registry.php,v 1.83 2004/11/16 05:31:31 cellog Exp $ /* TODO: @@ -191,6 +191,16 @@ if (!$initializing) { $initializing = true; $this->_dependencyDB = &PEAR_DependencyDB::singleton($this->_config); + if (PEAR::isError($this->_dependencyDB)) { + // attempt to recover by removing the dep db + @unlink($this->_config->get('php_dir', null, 'pear.php.net') . + DIRECTORY_SEPARATOR . '.depdb'); + $this->_dependencyDB = &PEAR_DependencyDB::singleton($this->_config); + if (PEAR::isError($this->_dependencyDB)) { + echo $this->_dependencyDB->getMessage(); + die('Unrecoverable error'); + } + } $initializing = false; } } http://cvs.php.net/diff.php/pear-core/PEAR/PackageFile/Generator/v1.php?r1=1.15&r2=1.16&ty=u Index: pear-core/PEAR/PackageFile/Generator/v1.php diff -u pear-core/PEAR/PackageFile/Generator/v1.php:1.15 pear-core/PEAR/PackageFile/Generator/v1.php:1.16 --- pear-core/PEAR/PackageFile/Generator/v1.php:1.15 Wed Nov 3 23:15:48 2004 +++ pear-core/PEAR/PackageFile/Generator/v1.php Tue Nov 16 00:31:31 2004 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: v1.php,v 1.15 2004/11/04 04:15:48 cellog Exp $ +// $Id: v1.php,v 1.16 2004/11/16 05:31:31 cellog Exp $ require_once 'PEAR/Validate.php'; /** * This class converts a PEAR_PackageFile_v1 object into any output format. @@ -624,6 +624,10 @@ if (count($deps['php']) > 1) { $php = $this->_processMultipleDeps($deps['php']); } else { + if (!isset($deps['php'][0])) { + list($key, $blah) = each ($deps['php']); // stupid buggy versions + $deps['php'] = array($blah[0]); + } $php = $this->_processDep($deps['php'][0]); if (!$php) { break; // poor mans throw @@ -781,6 +785,13 @@ $php['exclude'] = $dep['version']; break; case 'ge' : + if (!isset($dep['version'])) { + if ($dep['type'] == 'php') { + if (isset($dep['name'])) { + $dep['version'] = $dep['name']; + } + } + } $php['min'] = $dep['version']; break; case 'lt' :