Ondřej Vašík <[EMAIL PROTECTED]> 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. /Simon