Skip to contentSkip to conversation

master - tests: fix conf generation with older shells

PATCH Zdenek Kabelac 1 participant 1 message Oct 16, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=69bebfd9587e2db292051501d1a1e83d4f4564a5
Commit:        69bebfd9587e2db292051501d1a1e83d4f4564a5
Parent:        f1ac72c84804aa1c00aa385caec9eb007fd39aee
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Tue Oct 16 23:44:45 2018 +0200
Committer:     Zdenek Kabelac <[email protected]>
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(-)
test/lib/aux.sh +1 -1
index c3aeb43..c75ca6d 100644
@@ -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