Meta: Fix QEMU version check in run.sh

The QEMU version check in `Meta/run.sh` fails on macOS because the BSD
version of `grep` does not support the `-P` option. Using `sed` instead.
This commit is contained in:
Apoorv Mishra 2021-06-13 16:35:48 +05:30 committed by GitHub
parent 1fd547bf0b
commit f32ab73acc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,7 +44,7 @@ SERENITY_RUN="${SERENITY_RUN:-$1}"
}
SERENITY_QEMU_MIN_REQ_VERSION=5
installed_major_version=$("$SERENITY_QEMU_BIN" -version | head -n 1 | grep -Po "(?<=QEMU emulator version )([1-9]\d*|0)")
installed_major_version=$("$SERENITY_QEMU_BIN" -version | head -n 1 | sed -E 's/QEMU emulator version ([1-9][0-9]*|0).*/\1/')
[ "$installed_major_version" -lt "$SERENITY_QEMU_MIN_REQ_VERSION" ] && die "Required QEMU >= 5.0! Found $($SERENITY_QEMU_BIN -version | head -n 1)"
[ -z "$SERENITY_COMMON_QEMU_ARGS" ] && SERENITY_COMMON_QEMU_ARGS="