Ondřej Vašík wrote:
> as reported in RH bugzilla #253817
> (https://bugzilla.redhat.com/show_bug.cgi?id=253817), there is an issue
> with ls -v (and there will be same issue with sort -V soon). Problem is
> with sorting files with extensions or dist-tags (like .tar.gz)
> because .tar.gz is more than .1.tar.gz. Therefore foo-5.0.tar.gz will be
> considered as later version than foo-5.0.1.tar.gz .

In other words, the property that you expect from the comparison function
is that if
       cmp (s1, s2) < 0
then
       cmp (concat (prefix, s1, suffix), concat (prefix, s2, suffix)) < 0

for many values of PREFIX and SUFFIX. (At least when SUFFIX starts with a dot.)

> 3) to use/create different function for handling version sort (like
> rpmvercmp in <rpm/rpmlib.h> recommended in glibc strverscmp() bugzilla)

Does rpmvercmp have the above property?

Bruno



Reply via email to