Comment 1 for bug 1342041

Revision history for this message
Dmitry Ilyin (idv1985) wrote : Re: OpenStack Patching : puppet's versioncmp behaves wrong

Actually it's not really a versioncmp bug.

Puppet::Util::Package.versioncmp('2014.1.fuel5.0-mira4', '2014.1.1.fuel5.1-mira0')
=> 1

But first is lower then second and it should be -1

["2014", ".", "1", ".", "fuel", "5", ".", "0", "-", "mira", "4"]
["2014", ".", "1", ".", "1", ".", "fuel", "5", ".", "1", "-", "mira", "0"]
2014 vs 2014
. vs .
1 vs 1
. vs .
fuel vs 1
1

See? there are two 1's instead of one in the newer version. But it should be like this:
["2014", ".", "1", ".", "fuel", "5", ".", "0", "-", "mira", "4"]
["2014", ".", "1", ".", "fuel", "5", ".", "1", "-", "mira", "0"]
2014 vs 2014
. vs .
1 vs 1
. vs .
fuel vs fuel
5 vs 5
. vs .
0 vs 1
-1

So we should just rename package from 2014.1.1.fuel5.1-mira0 to 2014.1.fuel5.1-mira0