All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Kapshuk <alexander.kapshuk@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, alexander.kapshuk@gmail.com
Subject: [PATCH 2/2] ver_linux: Do not check for ver_linux pattern in version function
Date: Thu, 31 May 2018 22:22:47 +0300	[thread overview]
Message-ID: <20180531192247.9003-2-alexander.kapshuk@gmail.com> (raw)
In-Reply-To: <20180531192247.9003-1-alexander.kapshuk@gmail.com>

Checking whether output of commands matches the ver_linux pattern in
the version function is original shell implementation legacy code. When
the original implementation failed to locate a particular utility,
it generated error output along the lines of:

ver_linux:line number: command not found.

The awk implementation, does not contain the name of the script within the
body of the error message returned by the subshell when a given utility
fails to be located. The error message returned is along the lines of:

sh: name of utility: command not found

Safeguarding against the ver_linux pattern being found in the output
being parsed may thus be safely omitted.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
---
 scripts/ver_linux | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/ver_linux b/scripts/ver_linux
index e1dc041f903f..a6c728db05ce 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -70,7 +70,7 @@ BEGIN {
 function version(cmd,    ver) {
 	cmd = cmd " 2>&1"
 	while (cmd | getline > 0) {
-		if (!/ver_linux/ && match($0, /[0-9]+([.]?[0-9]+)+/)) {
+		if (match($0, /[0-9]+([.]?[0-9]+)+/)) {
 			ver = substr($0, RSTART, RLENGTH)
 			break
 		}
-- 
2.17.1

      reply	other threads:[~2018-05-31 19:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 19:22 [PATCH 1/2] ver_linux: Process input coming from procmaps that matches libc only Alexander Kapshuk
2018-05-31 19:22 ` Alexander Kapshuk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180531192247.9003-2-alexander.kapshuk@gmail.com \
    --to=alexander.kapshuk@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.