GNU bug report logs - #35939
version sort is incorrect with hyphen-minus

Previous Next

Package: coreutils;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Tue, 28 May 2019 00:55:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Florian Weimer <fweimer <at> redhat.com>
To: Vincent Lefevre <vincent <at> vinc17.net>
Cc: 35939 <at> debbugs.gnu.org, Paul Eggert <eggert <at> cs.ucla.edu>, Assaf Gordon <assafgordon <at> gmail.com>, Ian Jackson <ijackson <at> chiark.greenend.org.uk>
Subject: bug#35939: version sort is incorrect with hyphen-minus
Date: Fri, 28 Jun 2019 21:18:26 +0200
* Vincent Lefevre:

> On 2019-06-26 18:40:50 -0700, Paul Eggert wrote:
>> Perhaps the coreutils manual could be improved to make this all clearer, and
>> perhaps it should refer to the Debian manual if it doesn't already.
>
> In this case, there should be a new ordering option to provide
> true numeric sort with strings mixing non-negative integers and
> characters.

There's no one true numeric sort.  Some versioning schemes interpret
numbers after a dot as decimal fractions (so that 1.9 > 1.10), but it's
more common to split version strings into tuple somehow and then sort
the non-numeric parts lexicographically, and the numeric parts as
integers (so that 1.9 < 1.10).

Thanks,
Florian




This bug report was last modified 5 years and 351 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.