summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2003-08-31 06:53:46 +0000
committerGreg Beaver <cellog@php.net>2003-08-31 06:53:46 +0000
commit39105b9927632326995b46147fcfdb6fc1237fab (patch)
treee649139e3e06784dd1ea6bf467c81731e34eed90
parent0e6f284a6239ff3dabba6ea1d691332fa47c88bc (diff)
downloadphp-git-39105b9927632326995b46147fcfdb6fc1237fab.tar.gz
This patch should fix all unintended upgrading/installation of packages less stable than preferred state
-rw-r--r--pear/PEAR/Installer.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php
index d4057f4e8c..12bb502d5b 100644
--- a/pear/PEAR/Installer.php
+++ b/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);