Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1432716 > unrolled thread

[PATCH 01/32] ver_linux: complete awk implementation

Started byAlexander Kapshuk <alexander.kapshuk@gmail.com>
First post2016-06-28 12:30 +0200
Last post2016-06-28 12:30 +0200
Articles 20 on this page of 31 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 09/32] ver_linux: wrap up call to 'tune2fs' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 17/32] ver_linux: wrap up call to 'pppd --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 32/32] ver_linux: 'printversion()' function definition Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
      Re: [PATCH 32/32] ver_linux: 'printversion()' function definition Valdis.Kletnieks@vt.edu - 2016-06-28 14:50 +0200
        Re: [PATCH 32/32] ver_linux: 'printversion()' function definition Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 16:50 +0200
          Re: [PATCH 32/32] ver_linux: 'printversion()' function definition Valdis.Kletnieks@vt.edu - 2016-06-28 16:50 +0200
            Re: [PATCH 32/32] ver_linux: 'printversion()' function definition Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-07-02 09:40 +0200
    [PATCH 27/32] ver_linux: wrap up call to 'expr --v' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 02/32] ver_linux: assign the usage message to a variable and print it Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 11/32] ver_linux: wrap up call to 'reiserfsck -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 08/32] ver_linux: wrap up call to 'depmod -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 25/32] ver_linux: wrap up call to 'loadkeys -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 14/32] ver_linux: wrap up call to 'pccardctl -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 18/32] ver_linux: wrap up call to 'isdnctrl' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 12/32] ver_linux: wrap up call to 'fsck.reiser4 -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 10/32] ver_linux: wrap up call to 'fsck.jfs -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 06/32] ver_linux: wrap up call to 'ld -v' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 21/32] ver_linux: wrap up call to 'ldd --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 07/32] ver_linux: wrap up call to 'mount --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 30/32] ver_linux: build a list of kernel modules as a string and print it Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 28/32] ver_linux: wrap up call to 'udevadm --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 15/32] ver_linux: wrap up call to 'cardmgr -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 23/32] ver_linux: wrap up call to 'ps --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 31/32] ver_linux: 'version()' function definition Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 26/32] ver_linux: wrap up call to 'oprofiled --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 19/32] ver_linux: wrap up call to 'showmount --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 13/32] ver_linux: wrap up call to 'xfs_db -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 05/32] ver_linux: wrap up call to 'make --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 03/32] ver_linux: execute 'uname -a' from awk Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    [PATCH 20/32] ver_linux: wrap up querying for version of 'Linux C Library' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200

Page 1 of 2  [1] 2  Next page →


#1432716 — [PATCH 01/32] ver_linux: complete awk implementation

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 01/32] ver_linux: complete awk implementation
Message-ID<rOYrf-5Ep-13@gated-at.bofh.it>
The algorithm that extracts the version number of the utility being
queried, and prints the name of the utility and its version number is
currently implemented in awk. The code is used throughout the script,
making its use repetative. The proposed implementation confines the
algorithm in question to a function, which makes the script easier to
read overall, as well as considerably reduces the number of lines of
code. Every attempt has been made to retain the look and the format
generated by the current implementation.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 0d8bd29..30ecc6c 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -1,9 +1,9 @@
-#!/bin/sh
+#!/bin/awk -f
 # Before running this script please ensure that your PATH is
 # typical as you use for compilation/installation. I use
 # /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may
 # differ on your system.
-#
+
 echo 'If some fields are empty or look unusual you may have an old version.'
 echo 'Compare to the current minimal requirements in Documentation/Changes.'
 echo ' '
-- 
2.7.3

[toc] | [next] | [standalone]


#1432717 — [PATCH 09/32] ver_linux: wrap up call to 'tune2fs' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 09/32] ver_linux: wrap up call to 'tune2fs' in awk function
Message-ID<rOYrg-5Ep-29@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'tune2fs', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index c85ed58..757143d 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -18,13 +18,7 @@ BEGIN {
 	printversion("Util-linux", version("mount --version 2>&1"))
 	printversion("Mount", version("mount --version 2>&1"))
 	printversion("Module-init-tools", version("depmod -V  2>&1"))
-
-tune2fs 2>&1 |
-awk '/^tune2fs/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("E2fsprogs\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("E2fsprogs", version("tune2fs 2>&1"))
 
 fsck.jfs -V 2>&1 |
 awk '/version/{
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432718 — [PATCH 17/32] ver_linux: wrap up call to 'pppd --version' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 17/32] ver_linux: wrap up call to 'pppd --version' in awk function
Message-ID<rOYrg-5Ep-37@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'pppd --version', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 990b061..76e7e5f 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -26,13 +26,7 @@ BEGIN {
 	printversion("Pcmciautils", version("pccardctl -V 2>&1"))
 	printversion("Pcmcia-cs", version("cardmgr -V 2>&1"))
 	printversion("Quota-tools", version("quota -V 2>&1"))
-
-pppd --version 2>&1 |
-awk '/version/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("PPP\t\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("PPP", version("pppd --version 2>&1"))
 
 isdnctrl 2>&1 | grep version | awk \
 'NR==1{print "isdn4k-utils          ", $NF}'
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432719 — [PATCH 32/32] ver_linux: 'printversion()' function definition

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 32/32] ver_linux: 'printversion()' function definition
Message-ID<rOYrg-5Ep-39@gated-at.bofh.it>
In reply to#1432716
Definition of the 'printversion()' function. The function tests whether
the variable that contains the version number is empty, and prints
the name of the utility and its version number as a formatted string,
if the version number is not an empty value.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 27b43ae..430b201 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -80,3 +80,10 @@ function version(cmd,    ver) {
 	close(cmd)
 	return ver
 }
+
+function printversion(name, value,  ofmt) {
+	if (value != "") {
+		ofmt = "%-20s\t%s\n"
+		printf(ofmt, name, value)
+	}
+}
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432963 — Re: [PATCH 32/32] ver_linux: 'printversion()' function definition

FromValdis.Kletnieks@vt.edu
Date2016-06-28 14:50 +0200
SubjectRe: [PATCH 32/32] ver_linux: 'printversion()' function definition
Message-ID<rP0CJ-771-11@gated-at.bofh.it>
In reply to#1432719

[Multipart message — attachments visible in raw view] — view raw

On Tue, 28 Jun 2016 13:19:06 +0300, Alexander Kapshuk said:
> Definition of the 'printversion()' function. The function tests whether
> the variable that contains the version number is empty, and prints
> the name of the utility and its version number as a formatted string,
> if the version number is not an empty value.

This needs to be the first patch in the series, not the last, so that if
you're applying the patches one by one, the result still works, which allows
incremental testing after each patch.

Putting it last means you have to apply all 32 patches before you get
something you can test.

The idea is good, however.

One thing that might be good now that it's only one chunk of code, is to add
some code to check between the following cases: it's something like isdnctrl or
cardmgr that's not installed because it's truly optional in today's world where
ISDN or PCMCIA slots have become rare, or if the regexp doing the matching
failed because the utility is present but produced unexpected output.

Another useful thing would be distinguishing between must-have things
like the toolchain where the build *will* fail, and optionals that
are only used in some configurations.  This will probably require reordering
the output (and corresponding changes to Documentation/Changes)



[toc] | [prev] | [next] | [standalone]


#1433032 — Re: [PATCH 32/32] ver_linux: 'printversion()' function definition

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 16:50 +0200
SubjectRe: [PATCH 32/32] ver_linux: 'printversion()' function definition
Message-ID<rP2uR-8ng-1@gated-at.bofh.it>
In reply to#1432963
On Tue, Jun 28, 2016 at 3:47 PM,  <Valdis.Kletnieks@vt.edu> wrote:
> On Tue, 28 Jun 2016 13:19:06 +0300, Alexander Kapshuk said:
>> Definition of the 'printversion()' function. The function tests whether
>> the variable that contains the version number is empty, and prints
>> the name of the utility and its version number as a formatted string,
>> if the version number is not an empty value.
>
> This needs to be the first patch in the series, not the last, so that if
> you're applying the patches one by one, the result still works, which allows
> incremental testing after each patch.
>
> Putting it last means you have to apply all 32 patches before you get
> something you can test.

Thanks for your response.

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.

>
> The idea is good, however.
>
> One thing that might be good now that it's only one chunk of code, is to add
> some code to check between the following cases: it's something like isdnctrl or
> cardmgr that's not installed because it's truly optional in today's world where
> ISDN or PCMCIA slots have become rare, or if the regexp doing the matching
> failed because the utility is present but produced unexpected output.
>
> Another useful thing would be distinguishing between must-have things
> like the toolchain where the build *will* fail, and optionals that
> are only used in some configurations.  This will probably require reordering
> the output (and corresponding changes to Documentation/Changes)
>
>
>

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.

[toc] | [prev] | [next] | [standalone]


#1433035 — Re: [PATCH 32/32] ver_linux: 'printversion()' function definition

FromValdis.Kletnieks@vt.edu
Date2016-06-28 16:50 +0200
SubjectRe: [PATCH 32/32] ver_linux: 'printversion()' function definition
Message-ID<rP2uR-8ng-21@gated-at.bofh.it>
In reply to#1433032

[Multipart message — attachments visible in raw view] — view raw

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....

[toc] | [prev] | [next] | [standalone]


#1435737 — Re: [PATCH 32/32] ver_linux: 'printversion()' function definition

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-07-02 09:40 +0200
SubjectRe: [PATCH 32/32] ver_linux: 'printversion()' function definition
Message-ID<rQnGV-G0-9@gated-at.bofh.it>
In reply to#1433035
On Tue, Jun 28, 2016 at 5:48 PM,  <Valdis.Kletnieks@vt.edu> wrote:
> 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....
>

I do not mind reworking the script to make it report errors to the
user, if that is the behaviour expected by the community. The proposed
implementation follows the behaviour of the previous iterations of the
script based on its development history, which is to be silent about
those kinds of errors.

I have just been waiting for more feedback from the community before
making any further modifications to the proposed implementation.

Thanks.

[toc] | [prev] | [next] | [standalone]


#1432720 — [PATCH 27/32] ver_linux: wrap up call to 'expr --v' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 27/32] ver_linux: wrap up call to 'expr --v' in awk function
Message-ID<rOYrg-5Ep-45@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'expr --v', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index b8030d6..1bfe340 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -57,13 +57,7 @@ BEGIN {
 	printversion("Kbd", version("loadkeys -V 2>&1"))
 	printversion("Console-tools", version("loadkeys -V 2>&1"))
 	printversion("Oprofile", version("oprofiled --version 2>&1"))
-
-expr --v 2>&1 |
-awk '/^expr/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Sh-utils\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Sh-utils", version("expr --v 2>&1"))
 
 udevadm --version 2>&1 |
 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432722 — [PATCH 02/32] ver_linux: assign the usage message to a variable and print it

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 02/32] ver_linux: assign the usage message to a variable and print it
Message-ID<rOYrg-5Ep-35@gated-at.bofh.it>
In reply to#1432716
This patch assigns the usage message to a 'usage' variable and prints it.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
---
 scripts/ver_linux | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 30ecc6c..2f1d494 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -4,9 +4,10 @@
 # /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may
 # differ on your system.
 
-echo 'If some fields are empty or look unusual you may have an old version.'
-echo 'Compare to the current minimal requirements in Documentation/Changes.'
-echo ' '
+BEGIN {
+	usage = "If some fields are empty or look unusual you may have an old version.\n"
+	usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n"
+	print usage
 
 uname -a
 echo ' '
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432723 — [PATCH 11/32] ver_linux: wrap up call to 'reiserfsck -V' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 11/32] ver_linux: wrap up call to 'reiserfsck -V' in awk function
Message-ID<rOYrg-5Ep-41@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'reiserfsck -V', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index a77a94f..5fe23fb 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -20,13 +20,7 @@ BEGIN {
 	printversion("Module-init-tools", version("depmod -V  2>&1"))
 	printversion("E2fsprogs", version("tune2fs 2>&1"))
 	printversion("Jfsutils", version("fsck.jfs -V 2>&1"))
-
-reiserfsck -V 2>&1 |
-awk '/^reiserfsck/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Reiserfsprogs\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Reiserfsprogs", version("reiserfsck -V 2>&1"))
 
 fsck.reiser4 -V 2>&1 | grep ^fsck.reiser4 | awk \
 'NR==1{print "reiser4progs          ", $2}'
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432724 — [PATCH 08/32] ver_linux: wrap up call to 'depmod -V' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 08/32] ver_linux: wrap up call to 'depmod -V' in awk function
Message-ID<rOYrg-5Ep-27@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'depmod -V', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index d8a6cfe..c85ed58 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -17,13 +17,7 @@ BEGIN {
 	printversion("Binutils", version("ld -v 2>&1"))
 	printversion("Util-linux", version("mount --version 2>&1"))
 	printversion("Mount", version("mount --version 2>&1"))
-
-depmod -V  2>&1 |
-awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Module-init-tools\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Module-init-tools", version("depmod -V  2>&1"))
 
 tune2fs 2>&1 |
 awk '/^tune2fs/{
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432725 — [PATCH 25/32] ver_linux: wrap up call to 'loadkeys -V' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 25/32] ver_linux: wrap up call to 'loadkeys -V' in awk function
Message-ID<rOYrg-5Ep-43@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'loadkeys -V', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index ac5a7f9..5eff838 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -54,13 +54,8 @@ BEGIN {
 
 	printversion("Procps", version("ps --version 2>&1"))
 	printversion("Net-tools", version("ifconfig --version 2>&1"))
-
-loadkeys -V 2>&1 |
-awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	$0 = substr($0,RSTART,RLENGTH)
-	printf("Kbd\t\t\t%s\nConsole-tools\t\t%s\n",$0,$0)
-}'
+	printversion("Kbd", version("loadkeys -V 2>&1"))
+	printversion("Console-tools", version("loadkeys -V 2>&1"))
 
 oprofiled --version 2>&1 | awk \
 '(NR==1 && ($2 == "oprofile")) {print "oprofile              ", $3}'
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432726 — [PATCH 14/32] ver_linux: wrap up call to 'pccardctl -V' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 14/32] ver_linux: wrap up call to 'pccardctl -V' in awk function
Message-ID<rOYrg-5Ep-47@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'pccardctl -V', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index a54db0d..b2145a9 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -23,13 +23,7 @@ BEGIN {
 	printversion("Reiserfsprogs", version("reiserfsck -V 2>&1"))
 	printversion("Reiser4fsprogs", version("fsck.reiser4 -V 2>&1"))
 	printversion("Xfsprogs", version("xfs_db -V 2>&1"))
-
-pccardctl -V 2>&1 |
-awk '/pcmciautils/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Pcmciautils\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Pcmciautils", version("pccardctl -V 2>&1"))
 
 cardmgr -V 2>&1| grep version | awk \
 'NR==1{print "pcmcia-cs             ", $3}'
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432727 — [PATCH 18/32] ver_linux: wrap up call to 'isdnctrl' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 18/32] ver_linux: wrap up call to 'isdnctrl' in awk function
Message-ID<rOYrg-5Ep-51@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'isdnctrl', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 76e7e5f..1359fd8 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -27,9 +27,7 @@ BEGIN {
 	printversion("Pcmcia-cs", version("cardmgr -V 2>&1"))
 	printversion("Quota-tools", version("quota -V 2>&1"))
 	printversion("PPP", version("pppd --version 2>&1"))
-
-isdnctrl 2>&1 | grep version | awk \
-'NR==1{print "isdn4k-utils          ", $NF}'
+	printversion("Isdn4k-utils", version("isdnctrl 2>&1"))
 
 showmount --version 2>&1 | grep nfs-utils | awk \
 'NR==1{print "nfs-utils             ", $NF}'
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432728 — [PATCH 12/32] ver_linux: wrap up call to 'fsck.reiser4 -V' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 12/32] ver_linux: wrap up call to 'fsck.reiser4 -V' in awk function
Message-ID<rOYrg-5Ep-53@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'fsck.reiser4 -V', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 5fe23fb..2637f2b 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -21,9 +21,7 @@ BEGIN {
 	printversion("E2fsprogs", version("tune2fs 2>&1"))
 	printversion("Jfsutils", version("fsck.jfs -V 2>&1"))
 	printversion("Reiserfsprogs", version("reiserfsck -V 2>&1"))
-
-fsck.reiser4 -V 2>&1 | grep ^fsck.reiser4 | awk \
-'NR==1{print "reiser4progs          ", $2}'
+	printversion("Reiser4fsprogs", version("fsck.reiser4 -V 2>&1"))
 
 xfs_db -V 2>&1 |
 awk '/version/{
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432730 — [PATCH 10/32] ver_linux: wrap up call to 'fsck.jfs -V' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 10/32] ver_linux: wrap up call to 'fsck.jfs -V' in awk function
Message-ID<rOYrh-5Ep-65@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'fsck.jfs -V', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 757143d..a77a94f 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -19,13 +19,7 @@ BEGIN {
 	printversion("Mount", version("mount --version 2>&1"))
 	printversion("Module-init-tools", version("depmod -V  2>&1"))
 	printversion("E2fsprogs", version("tune2fs 2>&1"))
-
-fsck.jfs -V 2>&1 |
-awk '/version/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Jfsutils\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Jfsutils", version("fsck.jfs -V 2>&1"))
 
 reiserfsck -V 2>&1 |
 awk '/^reiserfsck/{
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432731 — [PATCH 06/32] ver_linux: wrap up call to 'ld -v' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 06/32] ver_linux: wrap up call to 'ld -v' in awk function
Message-ID<rOYrh-5Ep-67@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'ld -v', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 3042291..58aafb3 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -14,13 +14,7 @@ BEGIN {
 
 	printversion("GNU C", version("gcc -dumpversion 2>&1"))
 	printversion("GNU Make", version("make --version 2>&1"))
-
-ld -v 2>&1 |
-awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Binutils\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Binutils", version("ld -v 2>&1"))
 
 mount --version 2>&1 |
 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432732 — [PATCH 21/32] ver_linux: wrap up call to 'ldd --version' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 21/32] ver_linux: wrap up call to 'ldd --version' in awk function
Message-ID<rOYrh-5Ep-69@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'ldd --version', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index d3faf4a..08f3d5b 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -41,12 +41,7 @@ BEGIN {
 		}
 	}
 
-ldd --version 2>&1 |
-awk '/^ldd/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Dynamic linker (ldd)\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Dynamic linker (ldd)", version("ldd --version 2>&1"))
 
 libcpp=`ldconfig -p 2>/dev/null |
 	awk '/(libg|stdc)[+]+\.so/ {
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1432733 — [PATCH 07/32] ver_linux: wrap up call to 'mount --version' in awk function

FromAlexander Kapshuk <alexander.kapshuk@gmail.com>
Date2016-06-28 12:30 +0200
Subject[PATCH 07/32] ver_linux: wrap up call to 'mount --version' in awk function
Message-ID<rOYrh-5Ep-71@gated-at.bofh.it>
In reply to#1432716
Wrap up the call to 'mount --version', the code to process its output,
and the resulting formatted output in awk functions.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 58aafb3..d8a6cfe 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -15,13 +15,8 @@ BEGIN {
 	printversion("GNU C", version("gcc -dumpversion 2>&1"))
 	printversion("GNU Make", version("make --version 2>&1"))
 	printversion("Binutils", version("ld -v 2>&1"))
-
-mount --version 2>&1 |
-awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	$0 = substr($0,RSTART,RLENGTH)
-	printf("Util-linux\t\t%s\nMount\t\t\t%s\n",$0,$0)
-}'
+	printversion("Util-linux", version("mount --version 2>&1"))
+	printversion("Mount", version("mount --version 2>&1"))
 
 depmod -V  2>&1 |
 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.kernel


csiph-web