Bug#781657: needrestart: pending kernel upgrade warning when new kernel is already running -> Bug in libsort-naturally-perl
Axel Beckert
abe at debian.org
Mon Apr 27 07:54:37 UTC 2015
Control: clone -1 -2
Control: reassign -2 libsort-naturally-perl 1.02-1
Control: retitle -2 libsort-naturally-perl: Doesn't sort properly with numbers at the beginning of a string
Control: tag -2 = upstream
Hi,
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
$
Cloning this bug report accordingly.
> Upstream has been fixed by porting the version comparing stuff from
> Dpkg::Version into a simplified implementation in needrestart.
Hrm, why copying and causing code duplication instead of just simply
using "use Dpkg:Version;"?
Regards, Axel
--
,''`. | Axel Beckert <abe at debian.org>, 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
More information about the pkg-perl-maintainers
mailing list