1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00

This patch should fix all unintended upgrading/installation of packages less stable than preferred state

This commit is contained in:
Greg Beaver
2003-08-31 06:53:46 +00:00
parent 0e6f284a62
commit 39105b9927

View File

@@ -566,6 +566,13 @@ class PEAR_Installer extends PEAR_Common
if (!$willinstall) {
$willinstall = array();
}
if (!$state) {
$state = $config->get('preferred_state');
if (!$state) {
// don't inadvertantly use a non-set preferred_state
$state = null;
}
}
$mywillinstall = array();
$php_dir = $config->get('php_dir');
if (isset($options['installroot'])) {
@@ -582,6 +589,10 @@ class PEAR_Installer extends PEAR_Common
// download files in this list if necessary
foreach($packages as $pkgfile) {
$pkgfile = $this->extractDownloadFileName($pkgfile, $version);
if ($version === null) {
// use preferred state if no version number was specified
$version = $state;
}
if ($this->validPackageName($pkgfile) && !isset($options['upgrade'])) {
if ($this->registry->packageExists($pkgfile)) {
$this->log(0, "Package '$pkgfile' already installed, skipping");
@@ -609,7 +620,6 @@ class PEAR_Installer extends PEAR_Common
if (isset($options['alldeps']) || isset($options['onlyreqdeps'])) {
$reg = new PEAR_Registry($config->get('php_dir'));
if (!$installed) {
$state = $config->get('preferred_state');
$installed = $reg->listPackages();
array_walk($installed, create_function('&$v,$k','$v = strtolower($v);'));
$installed = array_flip($installed);