1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2019-06-19 23:55:44 +02:00
parent f3a87a2c2e
commit a311684c4a

View File

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