Browse Source

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

PEAR_1_4DEV
Greg Beaver 23 years ago
parent
commit
39105b9927
  1. 12
      pear/PEAR/Installer.php

12
pear/PEAR/Installer.php

@ -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);

Loading…
Cancel
Save