From cefa2556f32c31d9494a2ea737f90a7bde2fcf5b Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Wed, 15 May 2024 10:57:27 +0100 Subject: [PATCH] refactor: get QEMU version from qemu-img; avoids architecture complications --- quickemu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickemu b/quickemu index e6f6cc9..f86e5c2 100755 --- a/quickemu +++ b/quickemu @@ -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