From 75c6a06d445dc7a1c8f78971848966fcbf6fd07c Mon Sep 17 00:00:00 2001 From: Philippe Vanhaesendonck Date: Thu, 19 Sep 2024 09:06:57 +0200 Subject: [PATCH] fix(olss): :bug: osinfo-query sorts alphabetically. Use a version-based sort on the output of osinfo-query to ensure we always use the latest available variant when creating the initial VM. Credit to Andy West for spotting this issue and proposing a fix. Signed-off-by: Philippe Vanhaesendonck --- oracle-linux-image-tools/bin/build-image.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/oracle-linux-image-tools/bin/build-image.sh b/oracle-linux-image-tools/bin/build-image.sh index 6630631..25c701c 100755 --- a/oracle-linux-image-tools/bin/build-image.sh +++ b/oracle-linux-image-tools/bin/build-image.sh @@ -196,6 +196,7 @@ load_env() { if [[ -z ${OS_VARIANT} ]]; then OS_VARIANT=$(osinfo-query os --fields=short-id vendor="Oracle America" | grep "ol${ORACLE_RELEASE}\." | + sort -V | tail -1 | sed -e 's/ //g') fi