1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

aux: fix version checking

New dmpd tools return version string in different format,
so update code to understand both variant.

Also hide some shell var setting to local functions.
This commit is contained in:
Zdenek Kabelac 2023-07-15 10:20:32 +02:00
parent 81ef1fd0cc
commit 914d793858
2 changed files with 8 additions and 5 deletions

View File

@ -32,8 +32,8 @@ check_daemon_in_builddir() {
} }
create_corosync_conf() { create_corosync_conf() {
COROSYNC_CONF="/etc/corosync/corosync.conf" local COROSYNC_CONF="/etc/corosync/corosync.conf"
COROSYNC_NODE=$(hostname) local COROSYNC_NODE=$(hostname)
if test -a "$COROSYNC_CONF"; then if test -a "$COROSYNC_CONF"; then
if ! grep "created by lvm test suite" "$COROSYNC_CONF"; then if ! grep "created by lvm test suite" "$COROSYNC_CONF"; then
@ -47,8 +47,9 @@ create_corosync_conf() {
echo "created new $COROSYNC_CONF" echo "created new $COROSYNC_CONF"
} }
DLM_CONF="/etc/dlm/dlm.conf"
create_dlm_conf() { create_dlm_conf() {
local DLM_CONF="/etc/dlm/dlm.conf"
if test -a "$DLM_CONF"; then if test -a "$DLM_CONF"; then
if ! grep "created by lvm test suite" "$DLM_CONF"; then if ! grep "created by lvm test suite" "$DLM_CONF"; then
rm "$DLM_CONF" rm "$DLM_CONF"
@ -83,8 +84,9 @@ prepare_dlm() {
fi fi
} }
SANLOCK_CONF="/etc/sanlock/sanlock.conf"
create_sanlock_conf() { create_sanlock_conf() {
local SANLOCK_CONF="/etc/sanlock/sanlock.conf"
if test -a "$SANLOCK_CONF"; then if test -a "$SANLOCK_CONF"; then
if ! grep "created by lvm test suite" "$SANLOCK_CONF"; then if ! grep "created by lvm test suite" "$SANLOCK_CONF"; then
rm "$SANLOCK_CONF" rm "$SANLOCK_CONF"
@ -1949,6 +1951,7 @@ have_tool_at_least() {
local version local version
version=$("$1" -V 2>/dev/null) version=$("$1" -V 2>/dev/null)
version=${version%%-*} version=${version%%-*}
version=${version##* }
shift shift
version_at_least "$version" "$@" version_at_least "$version" "$@"

View File

@ -20,7 +20,7 @@ export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
which mkfs.ext4 || skip which mkfs.ext4 || skip
which fsck || skip which fsck || skip
which thin_restore || skip aux have_tool_at_least "$LVM_TEST_THIN_RESTORE_CMD" 0 3 1 || skip
aux have_thin 1 5 0 || skip aux have_thin 1 5 0 || skip
_convert_to_thin() { _convert_to_thin() {