1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-08-29 01:49:28 +03:00

tests: fix unbound variable

Test `aux kernel_at_least 5 1` fails even for newer kernel
with `$3: unbound variable` when using `set -u`.
This commit is contained in:
Marian Csontos
2019-07-23 15:36:13 +02:00
committed by Zdenek Kabelac
parent 6b3d0166ee
commit d1db024e16

View File

@ -1548,17 +1548,17 @@ version_at_least() {
IFS=".-" read -r major minor revision <<< "$1"
shift
test -z "$1" && return 0
test -n "${1:-}" || return 0
test -n "$major" || return 1
test "$major" -gt "$1" && return 0
test "$major" -eq "$1" || return 1
test -z "$2" && return 0
test -n "${2:-}" || return 0
test -n "$minor" || return 1
test "$minor" -gt "$2" && return 0
test "$minor" -eq "$2" || return 1
test -z "$3" && return 0
test -n "${3:-}" || return 0
test "$revision" -ge "$3" 2>/dev/null || return 1
}
#