stable-2.02 - aux: fix selecting lvmconf values
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a311684c4ab0ec2cf3a3d11412295da52df63c88 Commit: a311684c4ab0ec2cf3a3d11412295da52df63c88 Parent: f3a87a2c2e339328ea4d7448f43d5317806a6b24 Author: Zdenek Kabelac <[email protected]> AuthorDate: Wed Jun 19 23:55:44 2019 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Thu Jun 20 00:05:46 2019 +0200
aux: fix selecting lvmconf values
For older bashes (i.e. rhel5) code can't use internal bash arrays and uses old-school greps and sorts to create configuration file. But the split of value was mismatching names with same prefix so i.e.
devices/scan
devices/scan_lvs
was matching always the later one - fix this by expecting whitespace or '=' after the name.
--- test/lib/aux.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
test/lib/aux.sh +1 -1
@@ -1296,7 +1296,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[ =]" "$config_values" | tail -n 1 | sed -e "s,^$s/, ," || true done echo "}" echo