diff options
author | Alexander Kapshuk <alexander.kapshuk@gmail.com> | 2015-10-12 21:39:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-17 21:55:26 -0700 |
commit | 53494ba9dac543ffce5bc717556b111ca8c44b7e (patch) | |
tree | e613b6b59a59f221d7db53359ef6505c06bd4880 /scripts/ver_linux | |
parent | 1e5f739c61f669fdd954b1f16674c07bdf5ef8a1 (diff) | |
download | op-kernel-dev-53494ba9dac543ffce5bc717556b111ca8c44b7e.zip op-kernel-dev-53494ba9dac543ffce5bc717556b111ca8c44b7e.tar.gz |
ver_linux: libcpp, fix missing output
Neither 'libg++.so', nor 'libstdc++.so' were found where the current
implementation expects them to be found in the distros below.
Gentoo Linux
Debian 6.0.10
Oracle Linux Server release 7.1
Which results in zero ouput generated.
The proposed implementation relies on 'ldconfig' to locate the libraries
in question. 'Sed' is used to do the text processing.
Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/ver_linux')
-rwxr-xr-x | scripts/ver_linux | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/ver_linux b/scripts/ver_linux index a7d0eca..882ddb9 100755 --- a/scripts/ver_linux +++ b/scripts/ver_linux @@ -121,9 +121,18 @@ awk '/^ldd/{ substr($0,RSTART,RLENGTH)) }' -ls -l /usr/lib/libg++.so /usr/lib/libstdc++.so 2>/dev/null | awk -F. \ - '{print "Linux C++ Library " $4"."$5"."$6}' - +libcpp=`ldconfig -p 2>/dev/null | + awk '/(libg|stdc)[+]+\.so/ { + print $NF + exit + } +'` +test -r "$libcpp" && +ls -l $libcpp | +sed ' + s!.*so\.!! + s!^!Linux C++ Library\t! +' ps --version 2>&1 | grep version | awk \ 'NR==1{print "Procps ", $NF}' |