[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1467109146-20331-20-git-send-email-alexander.kapshuk@gmail.com>
Date: Tue, 28 Jun 2016 13:18:54 +0300
From: Alexander Kapshuk <alexander.kapshuk@...il.com>
To: linux-kernel@...r.kernel.org
Cc: gregkh@...uxfoundation.org,
Alexander Kapshuk <alexander.kapshuk@...il.com>
Subject: [PATCH 20/32] ver_linux: wrap up querying for version of 'Linux C Library' in awk function
Wrap up querying for version of 'Linux C Library', and the resulting
formatted output in an awk function.
Signed-off-by: Alexander Kapshuk <alexander.kapshuk@...il.com>
---
scripts/ver_linux | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/scripts/ver_linux b/scripts/ver_linux
index bb51c5d..d3faf4a 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -30,12 +30,16 @@ BEGIN {
printversion("Isdn4k-utils", version("isdnctrl 2>&1"))
printversion("Nfs-utils", version("showmount --version 2>&1"))
-test -r /proc/self/maps &&
-sed '
- /.*libc-\(.*\)\.so$/!d
- s//Linux C Library\t\t\1/
- q
-' /proc/self/maps
+ if (system("test -r /proc/self/maps") == 0) {
+ while (getline <"/proc/self/maps" > 0) {
+ n = split($0, procmaps, "/")
+ if (/libc.*so$/ && match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) {
+ ver = substr(procmaps[n], RSTART, RLENGTH)
+ printversion("Linux C Library", ver)
+ break
+ }
+ }
+ }
ldd --version 2>&1 |
awk '/^ldd/{
--
2.7.3
Powered by blists - more mailing lists