scripts/ver_linux lossage on Fedora 11
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...
scripts/ver_linux renamed from scripts/ver_linux.dist +6 -1
@@ -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}'
scripts/ver_linux oprofiled --version 2>&1 | awk \ · line 96
Quoted 7 lines · On Fri, 05 Jun 2009 14:59:53 EDT, [email protected] said:
scripts/ver_linux renamed from scripts/ver_linux.dist +5
-0+# older udev used this udevinfo -V 2>&1 | grep version | awk '{print "udev ", $3}' +# and newer use this +echo -n "udev " +udevadm --version +
Bah. This blows chunks on boxes that have older udev and no udevadm. Updated patch in the works....
Moral: Check caffienation levels *before* checking which boxes you tested on ;)