[Top][All Lists]

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

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

From: Simon Josefsson
Subject: Re: Issue with ls -v / sort -V and strverscmp() usage
Date: Wed, 03 Sep 2008 15:23:46 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Ondřej Vašík <address@hidden> writes:

> Bruno Haible wrote:
>> Ondřej Vašík wrote:
>> > 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?
> Similar. It separates name, epoch, version, release and architecture and
> compares those. Uses subsections of alphanum segments separated by
> non-alphanum chars. When same segment have different types, numeric is
> always considered as newer than alpha or alphanum. This solves issue
> with suffix, but changes behaviour for prefix (name) - as fully numeric
> project/file name will be considered as "newer" than alphanum
> project/file name and will be listed after alphanumeric names.

Do you know if the debian dpkg --compare-versions sort-order is
different from the rpm sort-order?

In any case, adding a new gnulib module with the documented semantic
'sort filenames in an order that makes sense when comparing software
versions' seems appropriate.  That allows us to change the logic later
if we find examples that sorts incorrectly.

Possibly the function could take a parameter to sort in RPM-mode or in
DPKG-mode, if those algorithms are substantially different, and both
outputs are needed by different applications.


reply via email to

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