refactor: get QEMU version from qemu-img; avoids architecture complications

This commit is contained in:
Martin Wimpress 2024-05-15 10:57:27 +01:00
parent 4d45cfbf9e
commit 4bd94e11d6
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3

View File

@ -1839,8 +1839,8 @@ if [ "${OS_KERNEL}" == "Darwin" ]; then
display="cocoa"
fi
QEMU_VER_LONG=$(${QEMU} -version | head -n1 | cut -d' ' -f4 | cut -d'(' -f1)
QEMU_VER_SHORT=$(${QEMU} -version | head -n1 | cut -d' ' -f4 | cut -d'(' -f1 | sed 's/\.//g' | cut -c1-2)
QEMU_VER_LONG=$(${QEMU_IMG} --version | head -1 | awk '{print $3}')
QEMU_VER_SHORT=$(echo "${QEMU_VER_LONG//./}" | cut -c1-2)
if [ "${QEMU_VER_SHORT}" -lt 60 ]; then
echo "ERROR! QEMU 6.0.0 or newer is required, detected ${QEMU_VER_LONG}."
exit 1