linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/32] ver_linux: complete awk implementation
@ 2016-06-28 10:18 Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 02/32] ver_linux: assign the usage message to a variable and print it Alexander Kapshuk
                   ` (31 more replies)
  0 siblings, 32 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 02/32] ver_linux: assign the usage message to a variable and print it
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 03/32] ver_linux: execute 'uname -a' from awk Alexander Kapshuk
                   ` (30 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 03/32] ver_linux: execute 'uname -a' from awk
  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 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 04/32] ver_linux: wrap up call to 'gcc -dumpversion' in awk function Alexander Kapshuk
                   ` (29 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Execute 'uname -a' using the awk system() function.

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 2f1d494..c509f09 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -9,8 +9,8 @@ BEGIN {
 	usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n"
 	print usage
 
-uname -a
-echo ' '
+	system("uname -a")
+	printf("\n")
 
 gcc -dumpversion 2>&1 |
 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 04/32] ver_linux: wrap up call to 'gcc -dumpversion' in awk function
  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 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 05/32] ver_linux: wrap up call to 'make --version' " Alexander Kapshuk
                   ` (28 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'gcc -dumpversion', 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 c509f09..9362782 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -12,12 +12,7 @@ BEGIN {
 	system("uname -a")
 	printf("\n")
 
-gcc -dumpversion 2>&1 |
-awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("GNU C\t\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("GNU C", version("gcc -dumpversion 2>&1"))
 
 make --version 2>&1 |
 awk '/GNU Make/{
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 05/32] ver_linux: wrap up call to 'make --version' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (2 preceding siblings ...)
  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 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 06/32] ver_linux: wrap up call to 'ld -v' " Alexander Kapshuk
                   ` (27 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'make --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 9362782..3042291 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -13,13 +13,7 @@ BEGIN {
 	printf("\n")
 
 	printversion("GNU C", version("gcc -dumpversion 2>&1"))
-
-make --version 2>&1 |
-awk '/GNU Make/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("GNU Make\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("GNU Make", version("make --version 2>&1"))
 
 ld -v 2>&1 |
 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 06/32] ver_linux: wrap up call to 'ld -v' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (3 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 05/32] ver_linux: wrap up call to 'make --version' " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 07/32] ver_linux: wrap up call to 'mount --version' " Alexander Kapshuk
                   ` (26 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 07/32] ver_linux: wrap up call to 'mount --version' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (4 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 06/32] ver_linux: wrap up call to 'ld -v' " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 08/32] ver_linux: wrap up call to 'depmod -V' " Alexander Kapshuk
                   ` (25 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 08/32] ver_linux: wrap up call to 'depmod -V' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (5 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 07/32] ver_linux: wrap up call to 'mount --version' " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 09/32] ver_linux: wrap up call to 'tune2fs' " Alexander Kapshuk
                   ` (24 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 09/32] ver_linux: wrap up call to 'tune2fs' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (6 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 08/32] ver_linux: wrap up call to 'depmod -V' " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 10/32] ver_linux: wrap up call to 'fsck.jfs -V' " Alexander Kapshuk
                   ` (23 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 10/32] ver_linux: wrap up call to 'fsck.jfs -V' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (7 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 09/32] ver_linux: wrap up call to 'tune2fs' " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 11/32] ver_linux: wrap up call to 'reiserfsck " Alexander Kapshuk
                   ` (22 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 11/32] ver_linux: wrap up call to 'reiserfsck -V' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (8 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 10/32] ver_linux: wrap up call to 'fsck.jfs -V' " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 12/32] ver_linux: wrap up call to 'fsck.reiser4 " Alexander Kapshuk
                   ` (21 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 12/32] ver_linux: wrap up call to 'fsck.reiser4 -V' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (9 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 11/32] ver_linux: wrap up call to 'reiserfsck " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 13/32] ver_linux: wrap up call to 'xfs_db " Alexander Kapshuk
                   ` (20 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 13/32] ver_linux: wrap up call to 'xfs_db -V' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (10 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 12/32] ver_linux: wrap up call to 'fsck.reiser4 " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 14/32] ver_linux: wrap up call to 'pccardctl " Alexander Kapshuk
                   ` (19 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'xfs_db -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 2637f2b..a54db0d 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -22,13 +22,7 @@ BEGIN {
 	printversion("Jfsutils", version("fsck.jfs -V 2>&1"))
 	printversion("Reiserfsprogs", version("reiserfsck -V 2>&1"))
 	printversion("Reiser4fsprogs", version("fsck.reiser4 -V 2>&1"))
-
-xfs_db -V 2>&1 |
-awk '/version/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Xfsprogs\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Xfsprogs", version("xfs_db -V 2>&1"))
 
 pccardctl -V 2>&1 |
 awk '/pcmciautils/{
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 14/32] ver_linux: wrap up call to 'pccardctl -V' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (11 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 13/32] ver_linux: wrap up call to 'xfs_db " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 15/32] ver_linux: wrap up call to 'cardmgr " Alexander Kapshuk
                   ` (18 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 15/32] ver_linux: wrap up call to 'cardmgr -V' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (12 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 14/32] ver_linux: wrap up call to 'pccardctl " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 16/32] ver_linux: wrap up call to 'quota " Alexander Kapshuk
                   ` (17 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'cardmgr -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 b2145a9..cdcd284 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -24,9 +24,7 @@ BEGIN {
 	printversion("Reiser4fsprogs", version("fsck.reiser4 -V 2>&1"))
 	printversion("Xfsprogs", version("xfs_db -V 2>&1"))
 	printversion("Pcmciautils", version("pccardctl -V 2>&1"))
-
-cardmgr -V 2>&1| grep version | awk \
-'NR==1{print "pcmcia-cs             ", $3}'
+	printversion("Pcmcia-cs", version("cardmgr -V 2>&1"))
 
 quota -V 2>&1 |
 awk '/version/{
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 16/32] ver_linux: wrap up call to 'quota -V' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (13 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 15/32] ver_linux: wrap up call to 'cardmgr " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 17/32] ver_linux: wrap up call to 'pppd --version' " Alexander Kapshuk
                   ` (16 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'quota -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 cdcd284..990b061 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -25,13 +25,7 @@ BEGIN {
 	printversion("Xfsprogs", version("xfs_db -V 2>&1"))
 	printversion("Pcmciautils", version("pccardctl -V 2>&1"))
 	printversion("Pcmcia-cs", version("cardmgr -V 2>&1"))
-
-quota -V 2>&1 |
-awk '/version/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Quota-tools\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Quota-tools", version("quota -V 2>&1"))
 
 pppd --version 2>&1 |
 awk '/version/{
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 17/32] ver_linux: wrap up call to 'pppd --version' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (14 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 16/32] ver_linux: wrap up call to 'quota " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 18/32] ver_linux: wrap up call to 'isdnctrl' " Alexander Kapshuk
                   ` (15 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 18/32] ver_linux: wrap up call to 'isdnctrl' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (15 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 17/32] ver_linux: wrap up call to 'pppd --version' " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 19/32] ver_linux: wrap up call to 'showmount --version' " Alexander Kapshuk
                   ` (14 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 19/32] ver_linux: wrap up call to 'showmount --version' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (16 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 18/32] ver_linux: wrap up call to 'isdnctrl' " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 20/32] ver_linux: wrap up querying for version of 'Linux C Library' " Alexander Kapshuk
                   ` (13 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'showmount --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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 1359fd8..bb51c5d 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -28,9 +28,7 @@ BEGIN {
 	printversion("Quota-tools", version("quota -V 2>&1"))
 	printversion("PPP", version("pppd --version 2>&1"))
 	printversion("Isdn4k-utils", version("isdnctrl 2>&1"))
-
-showmount --version 2>&1 | grep nfs-utils | awk \
-'NR==1{print "nfs-utils             ", $NF}'
+	printversion("Nfs-utils", version("showmount --version 2>&1"))
 
 test -r /proc/self/maps &&
 sed '
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 20/32] ver_linux: wrap up querying for version of 'Linux C Library' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (17 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 19/32] ver_linux: wrap up call to 'showmount --version' " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 21/32] ver_linux: wrap up call to 'ldd --version' " Alexander Kapshuk
                   ` (12 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 21/32] ver_linux: wrap up call to 'ldd --version' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (18 preceding siblings ...)
  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 ` 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
                   ` (11 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 22/32] ver_linux: wrap up querying for version of 'Linux C++ Library' in awk functions
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (19 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 21/32] ver_linux: wrap up call to 'ldd --version' " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 23/32] ver_linux: wrap up call to 'ps --version' in awk function Alexander Kapshuk
                   ` (10 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up querying for version of 'Linux C++ Library', 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 | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 08f3d5b..6111489 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -43,18 +43,15 @@ BEGIN {
 
 	printversion("Dynamic linker (ldd)", version("ldd --version 2>&1"))
 
-libcpp=`ldconfig -p 2>/dev/null |
-	awk '/(libg|stdc)[+]+\.so/ {
-	print $NF
-	exit
+	while ("ldconfig -p 2>/dev/null" | getline > 0) {
+		if (/(libg|stdc)[+]+\.so/) {
+			libcpp = $NF
+			break
+		}
 	}
-'`
-test -r "$libcpp" &&
-ls -l $libcpp |
-sed '
-	s!.*so\.!!
-	s!^!Linux C++ Library\t!
-'
+	if (system("test -r " libcpp) == 0)
+		printversion("Linux C++ Library", version("readlink " libcpp))
+
 ps --version 2>&1 |
 awk '/version/{
 	match($0, /[0-9]+([.]?[0-9]+)+/)
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 23/32] ver_linux: wrap up call to 'ps --version' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (20 preceding siblings ...)
  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 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 24/32] ver_linux: wrap up call to 'ifconfig " Alexander Kapshuk
                   ` (9 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'ps --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 6111489..5754af1 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -52,12 +52,7 @@ BEGIN {
 	if (system("test -r " libcpp) == 0)
 		printversion("Linux C++ Library", version("readlink " libcpp))
 
-ps --version 2>&1 |
-awk '/version/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Procps\t\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Procps", version("ps --version 2>&1"))
 
 ifconfig --version 2>&1 |
 awk '/tools/{
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 24/32] ver_linux: wrap up call to 'ifconfig --version' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (21 preceding siblings ...)
  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 ` Alexander Kapshuk
  2016-06-28 10:18 ` [PATCH 25/32] ver_linux: wrap up call to 'loadkeys -V' " Alexander Kapshuk
                   ` (8 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'ifconfig --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 5754af1..ac5a7f9 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -53,13 +53,7 @@ BEGIN {
 		printversion("Linux C++ Library", version("readlink " libcpp))
 
 	printversion("Procps", version("ps --version 2>&1"))
-
-ifconfig --version 2>&1 |
-awk '/tools/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Net-tools\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Net-tools", version("ifconfig --version 2>&1"))
 
 loadkeys -V 2>&1 |
 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 25/32] ver_linux: wrap up call to 'loadkeys -V' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (22 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 24/32] ver_linux: wrap up call to 'ifconfig " Alexander Kapshuk
@ 2016-06-28 10:18 ` Alexander Kapshuk
  2016-06-28 10:19 ` [PATCH 26/32] ver_linux: wrap up call to 'oprofiled --version' " Alexander Kapshuk
                   ` (7 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 26/32] ver_linux: wrap up call to 'oprofiled --version' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (23 preceding siblings ...)
  2016-06-28 10:18 ` [PATCH 25/32] ver_linux: wrap up call to 'loadkeys -V' " Alexander Kapshuk
@ 2016-06-28 10:19 ` Alexander Kapshuk
  2016-06-28 10:19 ` [PATCH 27/32] ver_linux: wrap up call to 'expr --v' " Alexander Kapshuk
                   ` (6 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'oprofiled --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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 5eff838..b8030d6 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -56,9 +56,7 @@ BEGIN {
 	printversion("Net-tools", version("ifconfig --version 2>&1"))
 	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}'
+	printversion("Oprofile", version("oprofiled --version 2>&1"))
 
 expr --v 2>&1 |
 awk '/^expr/{
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 27/32] ver_linux: wrap up call to 'expr --v' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (24 preceding siblings ...)
  2016-06-28 10:19 ` [PATCH 26/32] ver_linux: wrap up call to 'oprofiled --version' " Alexander Kapshuk
@ 2016-06-28 10:19 ` Alexander Kapshuk
  2016-06-28 10:19 ` [PATCH 28/32] ver_linux: wrap up call to 'udevadm --version' " Alexander Kapshuk
                   ` (5 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 28/32] ver_linux: wrap up call to 'udevadm --version' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (25 preceding siblings ...)
  2016-06-28 10:19 ` [PATCH 27/32] ver_linux: wrap up call to 'expr --v' " Alexander Kapshuk
@ 2016-06-28 10:19 ` Alexander Kapshuk
  2016-06-28 10:19 ` [PATCH 29/32] ver_linux: wrap up call to 'iwconfig " Alexander Kapshuk
                   ` (4 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'udevadm --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 1bfe340..a432d65 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -58,13 +58,7 @@ BEGIN {
 	printversion("Console-tools", version("loadkeys -V 2>&1"))
 	printversion("Oprofile", version("oprofiled --version 2>&1"))
 	printversion("Sh-utils", version("expr --v 2>&1"))
-
-udevadm --version 2>&1 |
-awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Udev\t\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Udev", version("udevadm --version 2>&1"))
 
 iwconfig --version 2>&1 |
 awk '/version/{
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 29/32] ver_linux: wrap up call to 'iwconfig --version' in awk function
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (26 preceding siblings ...)
  2016-06-28 10:19 ` [PATCH 28/32] ver_linux: wrap up call to 'udevadm --version' " Alexander Kapshuk
@ 2016-06-28 10:19 ` 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
                   ` (3 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Wrap up the call to 'iwconfig --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 a432d65..6bba20c 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -59,13 +59,7 @@ BEGIN {
 	printversion("Oprofile", version("oprofiled --version 2>&1"))
 	printversion("Sh-utils", version("expr --v 2>&1"))
 	printversion("Udev", version("udevadm --version 2>&1"))
-
-iwconfig --version 2>&1 |
-awk '/version/{
-	match($0, /[0-9]+([.]?[0-9]+)+/)
-	printf("Wireless-tools\t\t%s\n",
-	substr($0,RSTART,RLENGTH))
-}'
+	printversion("Wireless-tools", version("iwconfig --version 2>&1"))
 
 test -e /proc/modules &&
 sort /proc/modules |
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 30/32] ver_linux: build a list of kernel modules as a string and print it
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (27 preceding siblings ...)
  2016-06-28 10:19 ` [PATCH 29/32] ver_linux: wrap up call to 'iwconfig " Alexander Kapshuk
@ 2016-06-28 10:19 ` Alexander Kapshuk
  2016-06-28 10:19 ` [PATCH 31/32] ver_linux: 'version()' function definition Alexander Kapshuk
                   ` (2 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Reimplement the code that generates an alphabetically sorted list of
kernel modules in awk and print the name of this entry and the list of
modules via a function call.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 6bba20c..3bf72ad 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -61,16 +61,11 @@ BEGIN {
 	printversion("Udev", version("udevadm --version 2>&1"))
 	printversion("Wireless-tools", version("iwconfig --version 2>&1"))
 
-test -e /proc/modules &&
-sort /proc/modules |
-sed '
-	s/ .*//
-	H
-${
-	g
-	s/^\n/Modules Loaded\t\t/
-	y/\n/ /
-	q
+	if (system("test -r /proc/modules") == 0) {
+		while ("sort /proc/modules" | getline > 0) {
+			mods = mods sep $1
+			sep = " "
+		}
+		printversion("Modules Loaded", mods)
+	}
 }
-	d
-'
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 31/32] ver_linux: 'version()' function definition
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (28 preceding siblings ...)
  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 ` Alexander Kapshuk
  2016-06-28 10:19 ` [PATCH 32/32] ver_linux: 'printversion()' " Alexander Kapshuk
       [not found] ` <CAJ1xhMX3=tr3=EuFHjU6oiFTNrW5M2K32hEodBq_MrVtbKZB4g@mail.gmail.com>
  31 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

Definition of the 'version()' function. The function encapsulates the
algorithm that extracts the version number of the utility being queried,
and returns it as a value.

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

diff --git a/scripts/ver_linux b/scripts/ver_linux
index 3bf72ad..27b43ae 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -69,3 +69,14 @@ BEGIN {
 		printversion("Modules Loaded", mods)
 	}
 }
+
+function version(cmd,    ver) {
+	while (cmd | getline > 0) {
+		if (!/ver_linux/ && match($0, /[0-9]+([.]?[0-9]+)+/)) {
+			ver = substr($0, RSTART, RLENGTH)
+			break
+		}
+	}
+	close(cmd)
+	return ver
+}
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 32/32] ver_linux: 'printversion()' function definition
  2016-06-28 10:18 [PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk
                   ` (29 preceding siblings ...)
  2016-06-28 10:19 ` [PATCH 31/32] ver_linux: 'version()' function definition Alexander Kapshuk
@ 2016-06-28 10:19 ` Alexander Kapshuk
  2016-06-28 12:47   ` Valdis.Kletnieks
       [not found] ` <CAJ1xhMX3=tr3=EuFHjU6oiFTNrW5M2K32hEodBq_MrVtbKZB4g@mail.gmail.com>
  31 siblings, 1 reply; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 10:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexander Kapshuk

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

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* Re: [PATCH 32/32] ver_linux: 'printversion()' function definition
  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
  0 siblings, 1 reply; 39+ messages in thread
From: Valdis.Kletnieks @ 2016-06-28 12:47 UTC (permalink / raw)
  To: Alexander Kapshuk; +Cc: linux-kernel, gregkh

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

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)




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

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 32/32] ver_linux: 'printversion()' function definition
  2016-06-28 12:47   ` Valdis.Kletnieks
@ 2016-06-28 14:40     ` Alexander Kapshuk
  2016-06-28 14:48       ` Valdis.Kletnieks
  0 siblings, 1 reply; 39+ messages in thread
From: Alexander Kapshuk @ 2016-06-28 14:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Valdis.Kletnieks, Greg KH

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.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 32/32] ver_linux: 'printversion()' function definition
  2016-06-28 14:40     ` Alexander Kapshuk
@ 2016-06-28 14:48       ` Valdis.Kletnieks
  2016-07-02  7:29         ` Alexander Kapshuk
  0 siblings, 1 reply; 39+ messages in thread
From: Valdis.Kletnieks @ 2016-06-28 14:48 UTC (permalink / raw)
  To: Alexander Kapshuk; +Cc: linux-kernel, Greg KH

[-- 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 --]

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 32/32] ver_linux: 'printversion()' function definition
  2016-06-28 14:48       ` Valdis.Kletnieks
@ 2016-07-02  7:29         ` Alexander Kapshuk
  0 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-07-02  7:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Valdis Kletnieks, Greg KH

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.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Fwd: Fwd: [PATCH 01/32] ver_linux: complete awk implementation
       [not found]     ` <CAJ1xhMWea18Jo_Xk5aDn3uy=uF_cwdC8eYo_mUMPLWvNH+jX9Q@mail.gmail.com>
@ 2016-08-22  4:14       ` Alexander Kapshuk
  2016-08-22 10:00         ` Greg KH
  0 siblings, 1 reply; 39+ messages in thread
From: Alexander Kapshuk @ 2016-08-22  4:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg KH

---------- Forwarded message ----------
From: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Date: Sun, Aug 21, 2016 at 5:07 PM
Subject: Re: Fwd: [PATCH 01/32] ver_linux: complete awk implementation
To: Greg KH <gregkh@linuxfoundation.org>


On Sun, Aug 21, 2016 at 11:19 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Fri, Aug 19, 2016 at 09:12:28PM +0300, Alexander Kapshuk wrote:
> > Hello Greg,
> >
> > This is a follow-up on the series of 'ver_linux' patches I submitted at the end
> > of June, proposing a complete rewrite of the script in awk.
> >
> > So far, I have had feedback from one person, and I just wanted to get some
> > feedback from yourself too.
> >
> > I do appreciate the fact that you have other more pressing matters to attend to
> > at the moment, so there is no rush.
> >
> > I would appreciate hearing from you about my patches at your convenience.
>
> Last I saw, your patch series broke the build in the beginning and then
> fixed it up at the end, right?
>
> All patches have to never break the build, or functionality, at every
> step of the way.
>
> Sorry, it's a pain, but that's how the Linux kernel development model
> works.
>
> thanks,
>
> greg k-h


Thanks for your feedback and for clarifying how the Linux kernel
development model works.

Which of the two avenues presented below would you recommend taking?

(1). Submit a complete rewrite in awk as a single patch, to satisfy
the kernel development model requirements;
(2). Submit individual patches with repeating pieces of code
implemented as shell functions;

While my personal preference lies with option (1), I am willing to go
ahead with option (2), should the community prefer the shell
implementation over the awk one.

Thanks.

Alexander Kapshuk.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: Fwd: Fwd: [PATCH 01/32] ver_linux: complete awk implementation
  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
  0 siblings, 1 reply; 39+ messages in thread
From: Greg KH @ 2016-08-22 10:00 UTC (permalink / raw)
  To: Alexander Kapshuk; +Cc: linux-kernel

On Mon, Aug 22, 2016 at 07:14:10AM +0300, Alexander Kapshuk wrote:
> ---------- Forwarded message ----------
> From: Alexander Kapshuk <alexander.kapshuk@gmail.com>
> Date: Sun, Aug 21, 2016 at 5:07 PM
> Subject: Re: Fwd: [PATCH 01/32] ver_linux: complete awk implementation
> To: Greg KH <gregkh@linuxfoundation.org>
> 
> 
> On Sun, Aug 21, 2016 at 11:19 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Fri, Aug 19, 2016 at 09:12:28PM +0300, Alexander Kapshuk wrote:
> > > Hello Greg,
> > >
> > > This is a follow-up on the series of 'ver_linux' patches I submitted at the end
> > > of June, proposing a complete rewrite of the script in awk.
> > >
> > > So far, I have had feedback from one person, and I just wanted to get some
> > > feedback from yourself too.
> > >
> > > I do appreciate the fact that you have other more pressing matters to attend to
> > > at the moment, so there is no rush.
> > >
> > > I would appreciate hearing from you about my patches at your convenience.
> >
> > Last I saw, your patch series broke the build in the beginning and then
> > fixed it up at the end, right?
> >
> > All patches have to never break the build, or functionality, at every
> > step of the way.
> >
> > Sorry, it's a pain, but that's how the Linux kernel development model
> > works.
> >
> > thanks,
> >
> > greg k-h
> 
> 
> Thanks for your feedback and for clarifying how the Linux kernel
> development model works.
> 
> Which of the two avenues presented below would you recommend taking?
> 
> (1). Submit a complete rewrite in awk as a single patch, to satisfy
> the kernel development model requirements;
> (2). Submit individual patches with repeating pieces of code
> implemented as shell functions;
> 
> While my personal preference lies with option (1), I am willing to go
> ahead with option (2), should the community prefer the shell
> implementation over the awk one.

I think 1 might be good, but do it in 3 patches:
	- add new file scripts/ver_linux.awk
	- delete scripts/ver_linux
	- rename scripts/ver_linux.awk to scripts/ver_linux

the first one people can review, the second no one cares about, and the
third you can generate with the '-M' option to git format-patch so it
shows up as nothing at all.

Yes, for one patch there will not be the script, but I think we can live
with that :)

Sound better?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: Fwd: Fwd: [PATCH 01/32] ver_linux: complete awk implementation
  2016-08-22 10:00         ` Greg KH
@ 2016-08-22 16:59           ` Alexander Kapshuk
  0 siblings, 0 replies; 39+ messages in thread
From: Alexander Kapshuk @ 2016-08-22 16:59 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

On Mon, Aug 22, 2016 at 1:00 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Mon, Aug 22, 2016 at 07:14:10AM +0300, Alexander Kapshuk wrote:
>> ---------- Forwarded message ----------
>> From: Alexander Kapshuk <alexander.kapshuk@gmail.com>
>> Date: Sun, Aug 21, 2016 at 5:07 PM
>> Subject: Re: Fwd: [PATCH 01/32] ver_linux: complete awk implementation
>> To: Greg KH <gregkh@linuxfoundation.org>
>>
>>
>> On Sun, Aug 21, 2016 at 11:19 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> >
>> > On Fri, Aug 19, 2016 at 09:12:28PM +0300, Alexander Kapshuk wrote:
>> > > Hello Greg,
>> > >
>> > > This is a follow-up on the series of 'ver_linux' patches I submitted at the end
>> > > of June, proposing a complete rewrite of the script in awk.
>> > >
>> > > So far, I have had feedback from one person, and I just wanted to get some
>> > > feedback from yourself too.
>> > >
>> > > I do appreciate the fact that you have other more pressing matters to attend to
>> > > at the moment, so there is no rush.
>> > >
>> > > I would appreciate hearing from you about my patches at your convenience.
>> >
>> > Last I saw, your patch series broke the build in the beginning and then
>> > fixed it up at the end, right?
>> >
>> > All patches have to never break the build, or functionality, at every
>> > step of the way.
>> >
>> > Sorry, it's a pain, but that's how the Linux kernel development model
>> > works.
>> >
>> > thanks,
>> >
>> > greg k-h
>>
>>
>> Thanks for your feedback and for clarifying how the Linux kernel
>> development model works.
>>
>> Which of the two avenues presented below would you recommend taking?
>>
>> (1). Submit a complete rewrite in awk as a single patch, to satisfy
>> the kernel development model requirements;
>> (2). Submit individual patches with repeating pieces of code
>> implemented as shell functions;
>>
>> While my personal preference lies with option (1), I am willing to go
>> ahead with option (2), should the community prefer the shell
>> implementation over the awk one.
>
> I think 1 might be good, but do it in 3 patches:
>         - add new file scripts/ver_linux.awk
>         - delete scripts/ver_linux
>         - rename scripts/ver_linux.awk to scripts/ver_linux
>
> the first one people can review, the second no one cares about, and the
> third you can generate with the '-M' option to git format-patch so it
> shows up as nothing at all.
>
> Yes, for one patch there will not be the script, but I think we can live
> with that :)
>
> Sound better?
>
> thanks,
>
> greg k-h

Heaps better. Thanks.

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2016-08-22 17:00 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).