cvs: pear-core /PEAR/Command Install.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Thu, 10 Jul 2008 23:20:20 +0000 |
| Subject: | cvs: pear-core /PEAR/Command Install.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-7625@lists.php.net to get a copy of this message | ||
dufuz Thu Jul 10 23:20:20 2008 UTC
Modified files:
/pear-core/PEAR/Command Install.php
Log:
Bit of reconstructing in the filter for upgrade function, also use the passed state if viable else
fallback on preferred_state
Bug #14287 cannot upgrade from stable to beta via -beta when config is set to stable
http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Command/Install.php?r1=1.144&r2=1.145&diff_format=u
Index: pear-core/PEAR/Command/Install.php
diff -u pear-core/PEAR/Command/Install.php:1.144 pear-core/PEAR/Command/Install.php:1.145
--- pear-core/PEAR/Command/Install.php:1.144 Thu Jul 10 20:16:26 2008
+++ pear-core/PEAR/Command/Install.php Thu Jul 10 23:20:20 2008
@@ -16,7 +16,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2008 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Install.php,v 1.144 2008/07/10 20:16:26 dufuz Exp $
+ * @version CVS: $Id: Install.php,v 1.145 2008/07/10 23:20:20 dufuz Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -1167,11 +1167,9 @@
return $this->raiseError($chan);
}
- if ($chan->supportsREST($this->config->get('preferred_mirror',
- null, $channel)) &&
- $base = $chan->getBaseURL('REST1.0',
-
$this->config->get('preferred_mirror',
- null, $channel)))
+ $preferred_mirror = $this->config->get('preferred_mirror', null,
$channel);
+ if ($chan->supportsREST($preferred_mirror) &&
+ $base = $chan->getBaseURL('REST1.0', $preferred_mirror))
{
$dorest = true;
} else {
@@ -1180,15 +1178,19 @@
}
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
+ if (!isset($package['state'])) {
+ $state = $this->config->get('preferred_state', null, $channel);
+ } else {
+ $state = $package['state'];
+ }
+
if ($dorest) {
$rest = &$this->config->getREST('1.0', array());
$installed = array_flip($reg->listPackages($channel));
- $latest = $rest->listLatestUpgrades($base,
- $this->config->get('preferred_state', null, $channel),
$installed,
- $channel, $reg);
+
+ $latest = $rest->listLatestUpgrades($base, $state, $installed, $channel,
$reg);
} else {
- $latest = $remote->call('package.listLatestReleases',
- $this->config->get('preferred_state', null, $channel));
+ $latest = $remote->call('package.listLatestReleases', $state);
unset($remote);
}
@@ -1203,10 +1205,11 @@
}
// check package for latest release
- if (isset($latestReleases[$channel][strtolower($name)])) {
+ $name_lower = strtolower($name);
+ if (isset($latestReleases[$channel][$name_lower])) {
// if not set, up to date
- $inst_version = $reg->packageInfo($name, 'version', $channel);
- $channel_version =
$latestReleases[$channel][strtolower($name)]['version'];
+ $inst_version = $reg->packageInfo($name, 'version', $channel);
+ $channel_version = $latestReleases[$channel][$name_lower]['version'];
if (version_compare($channel_version, $inst_version, 'le')) {
// installed version is up-to-date
continue;