Merge "tests: fix daemon version in isDaemonNewer function" into main

This commit is contained in:
jade 2024-06-10 23:22:05 +00:00 committed by Gerrit Code Review
commit f432e464dd

View file

@ -146,7 +146,8 @@ fi
isDaemonNewer () {
[[ -n "${NIX_DAEMON_PACKAGE:-}" ]] || return 0
local requiredVersion="$1"
local daemonVersion=$($NIX_DAEMON_PACKAGE/bin/nix daemon --version | cut -d' ' -f3)
local versionOutput=$($NIX_DAEMON_PACKAGE/bin/nix daemon --version)
local daemonVersion=${versionOutput##* }
[[ $(nix eval --expr "builtins.compareVersions ''$daemonVersion'' ''$requiredVersion''") -ge 0 ]]
}