Package: extlinux
Version: 2:4.05+dfsg-6+deb7u1
Severity: wishlist
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

The current simple numeric sort fails now that the Linux kernel subversion is
going from single digit to two digits:

bjorn@nemi:/boot$ cd /boot && ls vmlinuz-* | grep -v .dpkg-tmp | sed -e 
's|vmlinuz-||g' | sort -nr
3.9.0-rc5+
3.8-1-amd64
3.2.0-4-amd64
3.10.0-rc1+
3.10.0-rc1

This is a bit annoying, having the newest kernels near the bottom of the list. 
Also
note that the + (which is produced when building a mainline kernel with 
additional
patches) makes the sort order even less logical.


Please use the 

       -V, --version-sort
              natural sort of (version) numbers within text

option available in the wheezy coreutils version of sort instead. This option
makes sort produce the version list in the correct order:

bjorn@nemi:/boot$ cd /boot && ls vmlinuz-* | grep -v .dpkg-tmp | sed -e 
's|vmlinuz-||g' | sort -Vr
3.10.0-rc1+
3.10.0-rc1
3.9.0-rc5+
3.8-1-amd64
3.2.0-4-amd64


bjorn@nemi:~$ dpkg -S `which sort`
coreutils: /usr/bin/sort

bjorn@nemi:~$ apt-cache policy coreutils
coreutils:
  Installed: 8.13-3.5
  Candidate: 8.13-3.5
  Version table:
     8.20-3 0
        600 http://ftp.no.debian.org/debian/ sid/main amd64 Packages
 *** 8.13-3.5 0
        700 http://ftp.no.debian.org/debian/ wheezy/main amd64 Packages
        100 /var/lib/dpkg/status



Simple patch attached.


Bjørn


- -- System Information:
Debian Release: 7.0
  APT prefers stable
  APT policy: (700, 'stable'), (600, 'unstable'), (500, 'stable-updates'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10.0-rc1+ (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages extlinux depends on:
ii  debconf [debconf-2.0]  1.5.49
ii  libc6                  2.13-38

Versions of packages extlinux recommends:
ii  os-prober               1.58
ii  syslinux-common         2:4.05+dfsg-6+deb7u1
ii  syslinux-themes-debian  11-1.1

extlinux suggests no packages.

- -- debconf information:
* extlinux/install: false

- -- debsums errors found:
debsums: changed file /usr/sbin/extlinux-update (from extlinux package)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlGPx3wACgkQ10rqkowbIslVXQCgglvi7LGTD/r3CW4ON5a71Pr1
Zi4An2l92QDP+6KTTxizdLH1jdKmABmN
=MMfU
-----END PGP SIGNATURE-----
--- /usr/sbin/extlinux-update.orig	2012-12-10 13:16:56.000000000 +0100
+++ /usr/sbin/extlinux-update	2013-05-12 18:36:21.559588617 +0200
@@ -155,7 +155,7 @@ _CONFIG="\
 "
 
 # Find linux versions
-_VERSIONS="$(cd /boot && ls vmlinuz-* | grep -v .dpkg-tmp | sed -e 's|vmlinuz-||g' | sort -nr)"
+_VERSIONS="$(cd /boot && ls vmlinuz-* | grep -v .dpkg-tmp | sed -e 's|vmlinuz-||g' | sort -Vr)"
 
 if [ "$(stat --printf %d /)" = "$(stat --printf %d /boot)" ]
 then

Reply via email to