mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 32/32] ver_linux: 'printversion()' function definition
Date: Tue, 28 Jun 2016 10:48:39 -0400	[thread overview]
Message-ID: <3402.1467125319@turing-police.cc.vt.edu> (raw)
In-Reply-To: <CAJ1xhMX190My+LyMYXuNF_3Hqg539cNoBnroBLu1=Be4MX81xA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1919 bytes --]

On Tue, 28 Jun 2016 17:40:36 +0300, Alexander Kapshuk said:

> Seeing this is a complete rewrite of the script from the shell
> language into awk, one would not be able to apply the patches
> submitted incrementally to be able to test each change being
> introduced separately. In this respect, defining the 'version()' and
> the 'printversion()' functions ahead of the code that calls them makes
> no difference.

Good point for this instance.  Note that reviewers in general expect
that sort of "must still work after every incremental commit" structure
in the future, though...


> If a utility being queried is not available on a given system, the
> shell that executes the script outputs an error  message along the
> lines of 'ver_linux: line number where the call is made: error
> message: name_of_utility Not found or something like that. This is
> taken care of by the 'if' block in the 'version()' function:
> if (!/ver_linux/...) {}
>
> The second condition that must be met in the 'if' block above takes
> care of situations where input does not match the regular expression
> for the version number:
> if (... && match($0, /[0-9]+([.]?[0-9]+)+/)) {}
>
> Only when the 'if' block above evaluates as being true is the 'ver'
> variable set to the string matched by the regular expression.
> The 'printversion()' function will not print anything should the value
> representing the version number, a list of kernel modules, etc, be
> found empty.
>
> If I understood your commentary correctly, the proposed implementation
> does address the issues you raise. Unless I misread something.

I meant that the distinction should be surfaced to the user - if the
binary returns a version string that our regexp can't parse, it's probably
a complete rewrite and we should *tell* the user that we don't know what's
going on.   An "if result = empty then print '(unable to identify version)'"
should be sufficient....


[-- Attachment #2: Type: application/pgp-signature, Size: 848 bytes --]

  reply	other threads:[~2016-06-28 14:48 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 02/32] ver_linux: assign the usage message to a variable and print it Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 03/32] ver_linux: execute 'uname -a' from awk Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 04/32] ver_linux: wrap up call to 'gcc -dumpversion' in awk function Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 05/32] ver_linux: wrap up call to 'make --version' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 06/32] ver_linux: wrap up call to 'ld -v' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 07/32] ver_linux: wrap up call to 'mount --version' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 08/32] ver_linux: wrap up call to 'depmod -V' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 09/32] ver_linux: wrap up call to 'tune2fs' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 10/32] ver_linux: wrap up call to 'fsck.jfs -V' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 11/32] ver_linux: wrap up call to 'reiserfsck " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 12/32] ver_linux: wrap up call to 'fsck.reiser4 " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 13/32] ver_linux: wrap up call to 'xfs_db " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 14/32] ver_linux: wrap up call to 'pccardctl " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 15/32] ver_linux: wrap up call to 'cardmgr " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 16/32] ver_linux: wrap up call to 'quota " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 17/32] ver_linux: wrap up call to 'pppd --version' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 18/32] ver_linux: wrap up call to 'isdnctrl' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 19/32] ver_linux: wrap up call to 'showmount --version' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 20/32] ver_linux: wrap up querying for version of 'Linux C Library' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 21/32] ver_linux: wrap up call to 'ldd --version' " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 22/32] ver_linux: wrap up querying for version of 'Linux C++ Library' in awk functions Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 23/32] ver_linux: wrap up call to 'ps --version' in awk function Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 24/32] ver_linux: wrap up call to 'ifconfig " Alexander Kapshuk
2016-06-28 10:18 ` [PATCH 25/32] ver_linux: wrap up call to 'loadkeys -V' " Alexander Kapshuk
2016-06-28 10:19 ` [PATCH 26/32] ver_linux: wrap up call to 'oprofiled --version' " Alexander Kapshuk
2016-06-28 10:19 ` [PATCH 27/32] ver_linux: wrap up call to 'expr --v' " Alexander Kapshuk
2016-06-28 10:19 ` [PATCH 28/32] ver_linux: wrap up call to 'udevadm --version' " Alexander Kapshuk
2016-06-28 10:19 ` [PATCH 29/32] ver_linux: wrap up call to 'iwconfig " Alexander Kapshuk
2016-06-28 10:19 ` [PATCH 30/32] ver_linux: build a list of kernel modules as a string and print it Alexander Kapshuk
2016-06-28 10:19 ` [PATCH 31/32] ver_linux: 'version()' function definition Alexander Kapshuk
2016-06-28 10:19 ` [PATCH 32/32] ver_linux: 'printversion()' " Alexander Kapshuk
2016-06-28 12:47   ` Valdis.Kletnieks
2016-06-28 14:40     ` Alexander Kapshuk
2016-06-28 14:48       ` Valdis.Kletnieks [this message]
2016-07-02  7:29         ` Alexander Kapshuk
     [not found] ` <CAJ1xhMX3=tr3=EuFHjU6oiFTNrW5M2K32hEodBq_MrVtbKZB4g@mail.gmail.com>
     [not found]   ` <20160821081931.GA14367@kroah.com>
     [not found]     ` <CAJ1xhMWea18Jo_Xk5aDn3uy=uF_cwdC8eYo_mUMPLWvNH+jX9Q@mail.gmail.com>
2016-08-22  4:14       ` Fwd: Fwd: [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
2016-08-22 10:00         ` Greg KH
2016-08-22 16:59           ` Alexander Kapshuk

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=3402.1467125319@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®