scripts/ver_linux lossage on Fedora 11

From: Valdis . Kletnieks
Date: Fri Jun 05 2009 - 15:00:11 EST


I found a few places where ver_linux fails to DTRT on Fedora 11

1) mount version
mount --version | awk '{print $NF}' | sed -e s/^mount-// -e s/\)$//

Unfortunately, Fedora's mount command says:

% mount --version
mount from util-linux-ng 2.14.2 (with libblkid and selinux support)

2) nsf-utils

showmount --version 2>&1 | grep nfs-utils | awk \
'NR==1{print "nfs-utils ", $NF}'

% showmount --version
showmount for 1.1.5
% rpm -q nfs-utils
nfs-utils-1.1.5-6.fc11.x86_64

3) udev

udevinfo -V 2>&1 | grep version | awk '{print "udev ", $3}

% udevinfo -V
the program '/bin/bash' called 'udevinfo', it should use 'udevadm info <options>', this will stop working in a future release
141
% udevadm --version
141

Patch for 2 of these attached. The showmount one may best be fixed by getting
the --version output fixed to include 'nfs-utils' - or do people think
changing it to another egrep [0-9] is the proper approach? If so, I'll do up
an updated patch...

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@xxxxxx>

--- linux-2.6.30-rc7-mmotm0602/scripts/ver_linux.dist 2009-03-23 19:12:14.000000000 -0400
+++ linux-2.6.30-rc7-mmotm0602/scripts/ver_linux 2009-06-03 14:17:43.000000000 -0400
@@ -23,7 +23,7 @@ echo -n "util-linux "
fdformat --version | awk '{print $NF}' | sed -e s/^util-linux-// -e s/\)$//

echo -n "mount "
-mount --version | awk '{print $NF}' | sed -e s/^mount-// -e s/\)$//
+mount --version | egrep -o '[0-9]+\.[0-9\.]+'

depmod -V 2>&1 | awk 'NR==1 {print "module-init-tools ",$NF}'

@@ -87,8 +87,13 @@ oprofiled --version 2>&1 | awk \

expr --v 2>&1 | awk 'NR==1{print "Sh-utils ", $NF}'

+# older udev used this
udevinfo -V 2>&1 | grep version | awk '{print "udev ", $3}'

+# and newer use this
+echo -n "udev "
+udevadm --version
+
iwconfig --version 2>&1 | awk \
'(NR==1 && ($3 == "version")) {print "wireless-tools ",$4}'



Attachment: pgp00000.pgp
Description: PGP signature