bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue with ls -v / sort -V and strverscmp() usage


From: Bruno Haible
Subject: Re: Issue with ls -v / sort -V and strverscmp() usage
Date: Wed, 3 Sep 2008 13:31:45 +0200
User-agent: KMail/1.5.4

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

[Prev in Thread] Current Thread [Next in Thread]