Subject: libsort-naturally-perl: Doesn't sort properly with numbers at the
beginning of a string
Date: Mon, 27 Apr 2015 10:10:13 +0200
Package: libsort-naturally-perl
Version: 1.02-1
Axel Beckert wrote:
> Control: clone -1 -2
Cloning of https://bugs.debian.org/781657 failed due to merged bugs.
So I rather just open a new one. My mail already had all relevant
information:
> Thomas Liske wrote:
> > On 04/01/2015 02:14 PM, Thomas Liske wrote:
> > > The expected kernel version reported by needrestart is the first one...
> > > I need to review why i.e. 4.9 looses against 3.10.
> >
> > the kernel version sorting was based on Sort::Naturally which does not
> > work since the rightmost integer found in the version string is used as
> > the primary sorting index. Therefore 4.0 will loose against any 3.x
> > (x>0) kernels :-/
>
> Thomas Liske wrote earlier:
> > $VAR1 = [
> > '4.20.0-rc6-tp520-btrfs-trim+',
> > '4.20.0',
> > '4.19.0-rc6-tp520-btrfs-trim+',
> > '4.19.0',
> > '4.10',
> > '3.19.3-rc6-tp520-btrfs-trim+',
> > '3.19.3',
> > '3.19.0-rc7-tp520+',
> > '3.10',
> > '4.9',
> > '4.4.0-foo',
> > '4.4.0',
> > '4.0.0-rc6-tp520-btrfs-trim+',
> > '4.0.0',
> > '4.0',
> > '3.9',
> > '3.3',
> > '2.6'
> > ];
> >
> > The expected kernel version reported by needrestart is the first one...
> > I need to review why i.e. 4.9 looses against 3.10.
>
> This looks like a bug in Sort::Naturally upstream:
>
> $ perl -MSort::Naturally -E 'say join("\n", nsort(qw(1.fnord 3.bar 1-foo 2.gnarz 3.19-foo 4.0-bla 3-19-foo 4-0-foo)))'
> 1.fnord
> 1-foo
> 2.gnarz
> 3.bar
> 4.0-bla
> 4-0-foo
> 3-19-foo
> 3.19-foo
> $
[Dropping the non-relevant stuff which only applied to needrestart]
Regards, Axel
--
,''`. | Axel Beckert <[email protected]>, http://people.debian.org/~abe/
: :' : | Debian Developer, ftp.ch.debian.org Admin
`. `' | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5
`- | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.