1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

tests: aux.sh check for already present config

'aux lvmconf' detects if new config needs to be regenerated.
This commit is contained in:
Zdenek Kabelac 2017-07-07 23:03:08 +02:00
parent 32c0dc3549
commit d426d7e709

View File

@ -1226,6 +1226,18 @@ EOF
lvmconf() {
unset profile_name
test $# -eq 0 || {
# Compare if passed args aren't already all in generated lvm.conf
local needed=0
for i in "$@"; do
val=$(grep "${i%%[={ ]*}" CONFIG_VALUES 2>/dev/null | tail -1) || { needed=1; break; }
test "$val" = "$i" || { needed=1; break; }
done
test "$needed" -eq 0 && {
echo "## LVMCONF: values are already there, skipping."
return 0 # not needed
}
}
generate_config "$@"
mv -f CONFIG "$LVM_SYSTEM_DIR/lvm.conf"
}