[lvm-devel] master - tests: fix conf generation with older shells

Zdenek Kabelac zkabelac at sourceware.org
Tue Oct 16 21:50:33 UTC 2018


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=69bebfd9587e2db292051501d1a1e83d4f4564a5
Commit:        69bebfd9587e2db292051501d1a1e83d4f4564a5
Parent:        f1ac72c84804aa1c00aa385caec9eb007fd39aee
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Tue Oct 16 23:44:45 2018 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Tue Oct 16 23:49:35 2018 +0200

tests: fix conf generation with older shells

For shells without array support, fix selecting bug,
and require keyword to end with some 'space' char,
so  'scan' is not matched with  'scan_var'.
---
 test/lib/aux.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index c3aeb43..c75ca6d 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1213,7 +1213,7 @@ EOF
 			echo "$s {"
 			local k
 			for k in $(grep ^"$s"/ "$config_values" | cut -f1 -d= | sed -e 's, *$,,' | sort | uniq); do
-				grep "^$k" "$config_values" | tail -n 1 | sed -e "s,^$s/,	 ," || true
+				grep "^$k[ \t]" "$config_values" | tail -n 1 | sed -e "s,^$s/,	 ," || true
 			done
 			echo "}"
 			echo




More information about the lvm-devel mailing list