Odd version comparison

Alpár Jüttner alpar at cs.elte.hu
Thu Sep 11 07:47:54 PDT 2008


I've just noticed that pkg-config (in fact the function rpmvercmp() in
pkg.c) compares the version numbers in a quite strange (and sometimes
dangerous) way.

For example if we have a package abc with version number 1.2.0, then

pkg-config --exists 'abc >=1.2.a'

answers 'no', but if the version of abc is 1.2.a, then 

pkg-config --exists 'abc >=1.2.0'

also answers 'no'.

That is both '1.2.0 >= 1.2.a' and '1.2.a >= 1.2.0' are false, but both
'1.2.0 <= 1.2.a' and '1.2.a <= 1.2.0' are true (and '1.2.0 = 1.2.a' is

Is this behavior intentional?

All the best,

More information about the pkg-config mailing list