bug#35939: version sort is incorrect with hyphen-minus

2019-06-28 Thread Florian Weimer
* 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

bug#35939: version sort is incorrect with hyphen-minus

2019-06-27 Thread Ian Jackson
Vincent Lefevre writes ("Re: bug#35939: version sort is incorrect with hyphen-minus"): > 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 man

bug#35939: version sort is incorrect with hyphen-minus

2019-06-27 Thread 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

bug#35939: version sort is incorrect with hyphen-minus

2019-06-26 Thread Paul Eggert
Thanks for looking into this. Sorry about my confusion between strverscmp and filevercmp. As this bug report appears to be about filevercmp, glibc is not involved; it's only Gnulib and the utilities using Gnulib's filevercmp module. As I now understand it, Gnulib filevercmp is intended to be

bug#35939: version sort is incorrect with hyphen-minus

2019-06-26 Thread Ian Jackson
Ian Jackson writes ("Re: bug#35939: version sort is incorrect with hyphen-minus"): > Paul Eggert writes ("Re: bug#35939: version sort is incorrect with > hyphen-minus"): > > GNU sort uses the same algorithm as glibc strverscmp, and this algorithm > > has

bug#35939: version sort is incorrect with hyphen-minus

2019-06-26 Thread Ian Jackson
Paul Eggert writes ("Re: bug#35939: version sort is incorrect with hyphen-minus"): > GNU sort uses the same algorithm as glibc strverscmp, and this algorithm has > changed only once since strverscmp was added to glibc in 1997. The change was > made in 2009, to fix t

bug#35939: version sort is incorrect with hyphen-minus

2019-06-26 Thread Assaf Gordon
Hello Paul, On Wed, Jun 26, 2019 at 12:57:14PM -0700, Paul Eggert wrote: > GNU sort uses the same algorithm as glibc strverscmp, I think that both sort and ls use 'filevercmp' - a simplified version that does not support locales (and doesn't fail). The change (from 'strvercmp') was made in:

bug#35939: version sort is incorrect with hyphen-minus

2019-06-26 Thread Vincent Lefevre
On 2019-06-26 12:25:26 -0600, Assaf Gordon wrote: > "ls -v" and "sort -V" (coreutils' version sort) behaves differently than > other implementations in regards to minus character: > > $ printf "%s\n" abb ab-cd | sort -V > abb > ab-cd > > $ v1="abb" > $ v2="ab-cd" > $ dpkg

bug#35939: version sort is incorrect with hyphen-minus

2019-06-26 Thread Ian Jackson
Assaf Gordon writes ("Re: bug#35939: version sort is incorrect with hyphen-minus"): > Thanks for the report and the clear details. Hi. I haven't read the original report, but everything you say about the behaviour of GNU coreutils and dpkg sounds correct. This is perhaps an unfort

bug#35939: version sort is incorrect with hyphen-minus

2019-06-26 Thread Paul Eggert
GNU sort uses the same algorithm as glibc strverscmp, and this algorithm has changed only once since strverscmp was added to glibc in 1997. The change was made in 2009, to fix this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=9913 Has the Debian version-comparison algorithm changed

bug#35939: version sort is incorrect with hyphen-minus

2019-06-26 Thread Assaf Gordon
(Adding Ian Jackson for dpkg/debian-version details) Hello, On Tue, May 28, 2019 at 02:53:39AM +0200, Vincent Lefevre wrote: > With GNU coreutils 8.30 under Debian/unstable, I get: > > $ LC_ALL=C ls > ab-cd abb abe > $ LC_ALL=C ls -v > abb abe ab-cd > > The hyphen-minus character should