Re: Version number weirdness
| From: | Jesus M. Castagnetto | Date: | Tue, 10 Jun 2003 09:07:24 +0000 |
| Subject: | Re: Version number weirdness | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17251@lists.php.net to get a copy of this message | ||
Nope. That is the expected behaviour, as letters used in a version spec are
interpreted such that a = alpha, b = beta. Also: dev < a < b < rc < pl
The problem is that Greg mislabelled this release, it could've been:
1.2.1
or even: (if it was a patch level release)
1.2.0pl1
For the whole story, see:
http://cvs.php.net/co.php/phpdoc/en/reference/info/functions/version-compare.xml?r=1.5
(this should show up the next time the manual is built)
The solution in this case would be to uninstall PhpDocumentor and then install
it again.
Try the following code:
$v1 = $v2 = array('1.2.0dev', '1.2.0a', '1.2.0b',
'1.2.0RC1', '1.2.0',
'1.2.0pl1');
foreach ($v1 as $version) {
echo "\n* Comparing with $version\n";
foreach ($v2 as $otherversion) {
if ($version == $otherversion) {
continue;
}
echo compver($version, $otherversion)."\n";
}
}
function compver($x, $y) {
$out = "\n$x = $y --> ";
$out .= (version_compare($x, $y, '=')) ? 'TRUE' : 'FALSE';
$out .= "\n$x < $y --> ";
$out .= (version_compare($x, $y, '<')) ? 'TRUE' : 'FALSE';
$out .= "\n$x > $y --> ";
$out .= (version_compare($x, $y, '>')) ? 'TRUE' : 'FALSE';
return $out;
}
--- Mika Tuupola <tuupola@appelsiini.net> wrote:
>
> There seem to be something broken with 0.0.0x style
> version numbers and list-upgrades command.
>
> -cut-
> (tuupola)[aurinko][pts/4]~#pear list-upgrades
> Available Upgrades (stable):
> ============================
> Package Version Size
> PhpDocumentor 1.2.0 2410kB
> (tuupola)[aurinko][pts/4]~#pear upgrade-all
>
> Release Warnings
> ================
> w
>
> w
> downloading PhpDocumentor-1.2.0a.tgz ...
> ...done: 2,474,864 bytes
> upgrade to a newer version (1.2.0a is not newer than 1.2.0a)
> (tuupola)[aurinko][pts/4]~#
> -cut-
> --
> Mika Tuupola
> http://www.appelsiini.net/~tuupola/
=====
--- Jesus M. Castagnetto (jcastagnetto@yahoo.com)
Research:
http://metallo.scripps.edu/
Personal: http://www.castagnetto.org/
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com