On Tuesday 10 of September 2013 15:37EN, Dominique Leuenberger a.k.a. Dimstar wrote:
Quoting Michal Kubeček <mkubecek@suse.cz>:
This could lead to unexpected results. Recently I found that RPM version comparison algorithm can be quite counter-intuitive when underscores are used as separators. In particular,
1.1.1_3.0.13_0.27-3.1 < 1_3.0.13_0.27-0.17.15
even if 1 < 1.1.1
That one is indeed a bit surprising.. but zypper confirms:
zypper vcmp 1.1.1_3.0.13_0.27-3.1 1_3.0.13_0.27-0.17.15
1.1.1_3.0.13_0.27-3.1 is older than 1_3.0.13_0.27-0.17.15
the 'rule of thumb' is that _ is being substituted with '.' as well as a '.' is added between numerical and alpha chars (hence: 1a == 1.a)
zypper vcmp 1a 1.a
1a matches 1.a
One problem with this is that it makes the way we are constructing KMP version strings rather fragile. As soon as module versions keep the same number of components, e.g. 1.0.0 -> 1.0.1 -> 1.0.2 -> 1.1.0 -> 1.1.1 -> ... you are safe. But once you try 1 -> 1.1 you are in trouble. Michal Kubeček -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org