Debian Bug report logs - #783457
libsort-naturally-perl: Doesn't sort properly with numbers at the beginning of a string

version graph

Package: libsort-naturally-perl; Maintainer for libsort-naturally-perl is Debian Perl Group <[email protected]>; Source for libsort-naturally-perl is src:libsort-naturally-perl (PTS, buildd, popcon).

Reported by: Axel Beckert <[email protected]>

Date: Mon, 27 Apr 2015 08:12:02 UTC

Severity: normal

Found in version libsort-naturally-perl/1.02-1

Forwarded to https://github.com/bingos/sort-naturally/issues/3

Full log


🔗 View this message in rfc822 format

X-Loop: [email protected]
Subject: Bug#783457: libsort-naturally-perl: Doesn't sort properly with numbers at the beginning of a string
Reply-To: Axel Beckert <[email protected]>, [email protected]
Resent-From: Axel Beckert <[email protected]>
Resent-To: [email protected]
Resent-CC: [email protected], Debian Perl Group <[email protected]>
X-Loop: [email protected]
Resent-Date: Mon, 27 Apr 2015 08:12:02 +0000
Resent-Message-ID: <[email protected]>
Resent-Sender: [email protected]
X-Debian-PR-Message: report 783457
X-Debian-PR-Package: libsort-naturally-perl
X-Debian-PR-Keywords: 
X-Debian-PR-Source: libsort-naturally-perl
Received: via spool by [email protected] id=B.143012221728728
          (code B); Mon, 27 Apr 2015 08:12:02 +0000
Received: (at submit) by bugs.debian.org; 27 Apr 2015 08:10:17 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.0-bugs.debian.org_2005_01_02
	(2014-02-07) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-15.0 required=4.0 tests=BAYES_00,FROMDEVELOPER,
	HAS_PACKAGE,HEADER_FROM_DIFFERENT_DOMAINS,T_RP_MATCHES_RCVD,X_DEBBUGS_CC
	autolearn=ham autolearn_force=no version=3.4.0-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 4; hammy, 150; neutral, 175; spammy,
	0. spammytokens: hammytokens:0.000-+--H*o:Debian, 0.000-+--HFace:sk:iVBORw0,
	0.000-+--H*F:U*abe, 0.000-+--H*u:1.5.21, 0.000-+--H*UA:1.5.21
Received: from sym2.noone.org ([178.63.92.236])
	by buxtehude.debian.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256)
	(Exim 4.80)
	(envelope-from <[email protected]>)
	id 1Yme7M-0007T5-PC
	for [email protected]; Mon, 27 Apr 2015 08:10:16 +0000
Received: by sym2.noone.org (Postfix, from userid 1000)
	id 3lZzLF6BMRzQWj9; Mon, 27 Apr 2015 10:10:13 +0200 (CEST)
Date: Mon, 27 Apr 2015 10:10:13 +0200
From: Axel Beckert <[email protected]>
To: [email protected]
Message-ID: <[email protected]>
References: <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[email protected]>
X-Operating-System: Linux 3.2.0-4-amd64
X-Machine: sym2 x86_64
X-Editor: GNU Emacs 23.4.1
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAAAAAC3mUtaAAAABGdBTUEAALGPC/xhBQAAADh0RVh0U29mdHdhcmUAWFYgVmVyc2lvbiAzLjEwYSAgUmV2OiAxMi8yOS85NCAoUE5HIHBhdGNoIDEuMindFS5JAAACGElEQVQ4jXXQMU8UYRDG8f8shNjdDH4AbpfGDjAWlKiJiZ0ajL1aGCvsNCbGaCGG1koLaztaTYz6ATy+gOyehYmF3MxVxgg3FnDsHcTpJr/M+8w7Rf6nCsaVTTDqxbg9hoOXmw83H71+Eyfg4E1d7/Z2fG9rGkZbTQiu+K+3U/C+76lmkvAhJuDndnoAiftou4V84okAGclop4U/jYACZDTxrYWP0gkxVfAm/W//GLZpxIzwIN0Hn8dw0B+IWkZmQmRsj2HfhwokEklHfNCCiQCRgAR7YyhQVRVTCKCzP4Y5zBBE0t0zY3Q8oQaBqqAMlVEcgVQd9706zGirAFium8HXumlMIeMwqQCInju+2+uB6MRENupdpMt8pRlHZyuAW0F+Mb6XSIVqtxjD+iVmVqqystLEzFTGT92YqRaXpNT5eTVjeJhbALPnrTxLUZUKZsgxcNm64hAOYisT/xhF+oKTGU5RegtC3Rt6eEDi/QnIevdTx9Md2EMmYBRmCQR1026FCGQQJJExsRUqgkMGaWSbwYLnoO4T6VgpbQbdELPMBAHWWrhYrcxXnYgAsatPWygkFCBD4K62MAsOTqA6szYRPpsu6e6Y8mPiVrBMNuGIMrgwBUu4p2DgG1Ownu6hpuTv7hScefHAzAC/yRRw5U5pALMbJ4AUALvHSZhxgHPXTsHcdWD1GadAHr9avP+c0wCr7263Df8ASLwXWHWs+KIAAAAHdElNRQfYBQEBODPr
Organization: The Debian Project
User-Agent: Mutt/1.5.21 (2010-09-15)
Delivered-To: [email protected]
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

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 14:16:24 2025; Machine Name: buxtehude

Debian Bug tracking system

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/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.