lvm2/0102-tests-cleanup-some-shellcheck-warns.patch

32 lines
1.2 KiB
Diff
Raw Normal View History

From 062b014c04d15ad5a5c0b8aaeb30166c33e0d763 Mon Sep 17 00:00:00 2001
From: Marian Csontos <mcsontos@redhat.com>
Date: Thu, 22 Jun 2023 18:01:27 +0200
Subject: [PATCH 102/115] tests: cleanup some shellcheck warns
(manually backported some changes from commit 773bc013778df631f9ee14e7a79d5f02211b1e67)
---
scripts/lvm_import_vdo.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh
index c4c1d152e..134c96513 100755
--- a/scripts/lvm_import_vdo.sh
+++ b/scripts/lvm_import_vdo.sh
@@ -255,11 +255,11 @@ convert2lvm_() {
# Find largest matching VG name to our 'default' vgname
LASTVGNAME=$(LC_ALL=C "$LVM" vgs -oname -O-name --noheadings -S name=~${VGNAME} | grep -E "${VGNAME}[0-9]? ?" | head -1 || true)
if test -n "$LASTVGNAME" ; then
- LASTVGNAME=${LASTVGNAME#*${VGNAME}}
+ LASTVGNAME=${LASTVGNAME#*"${VGNAME}"}
# If the number is becoming too high, try some random number
test "$LASTVGNAME" -gt 99999999 2>/dev/null && LASTVGNAME=$RANDOM
# Generate new unused VG name
- VGNAME="${VGNAME}$(( ${LASTVGNAME} + 1 ))"
+ VGNAME="${VGNAME}$(( LASTVGNAME + 1 ))"
verbose "Selected unused volume group name $VGNAME."
fi
fi
--
2.41.0