Summary: | Bizarre version comparison scheme | ||
---|---|---|---|
Product: | pkg-config | Reporter: | Jasper Lievisse Adriaanse <jasper> |
Component: | src | Assignee: | Tollef Fog Heen <tfheen> |
Status: | RESOLVED NOTABUG | QA Contact: | |
Severity: | major | ||
Priority: | medium | CC: | dbn.lists |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Jasper Lievisse Adriaanse
2011-06-07 06:12:22 UTC
pkg-config uses the rpmvercmp algorithm. Here's the upstream code from rpm if you're interested. I don't think there have been any significant code changes in years. http://rpm.org/gitweb?p=rpm.git;a=blob;f=lib/rpmvercmp.c;hb=HEAD rpmvercmp takes the stance that any alphabetical characters make the version _newer_ than the unadorned version. This works when you have a tweaked version that you want to be seen as newer than the regular version: 0.1 vs 0.1dbn. Unfortunately, it does not work for the alpha/beta/rc suffix. Here's the redhat bug where they haggle about this: https://bugzilla.redhat.com/show_bug.cgi?id=50977 I'm personally disinclined to change this algorithm now. Obviously, using a purely dotted decimal version will always do the right thing for you. Feel free to reopen if you feel really strongly about and we can discuss some more, but for now I feel comfortable being compatible with rpm. I'd like to say it even stronger: we're not going to change it now, since that is going to screw with people in the real world. (If we're going to change algorithm, I'd like to move to the dpkg algorithm where you can be explicit about version number ordering (because you have ~ which is less than anything, including the empty string). Apparently rpm grew ~ handling recently. We should import the changes to rpmvercmp(), it's not bad at all. http://rpm.org/ticket/56 http://rpm.org/gitweb?p=rpm.git;a=commitdiff;h=db28221a4a48f6ee3c804c92314330637c808638 |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.