ci: Fix bad handling of image format names

This is what caused vagrant_vmware_fusion to not be built.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This commit is contained in:
James Le Cuirot 2026-04-27 16:00:43 +01:00
parent e7c519d6fd
commit 0d8e0d6b1e
No known key found for this signature in database
GPG Key ID: 1226415D00DD3137
2 changed files with 14 additions and 13 deletions

View File

@ -189,13 +189,14 @@ jobs:
images_out="images"
if echo "$formats" | tr ' ' '\n' | grep -q '^vmware'; then
formats=$(echo "$formats" | tr ' ' '\n' | sed '/vmware.*/d')
formats+=" vmware vmware_ova vmware_raw"
printf -v formats "%s\n" ${formats}
if grep -q '^vmware' <<< "${formats}"; then
formats=$(grep -v '^vmware' <<< "${formats}")
printf -v formats "%s\n" ${formats} vmware vmware_ova vmware_raw
fi
if echo "$formats" | tr ' ' '\n' | grep -q -P '^(ami|aws)'; then
formats=$(echo "$formats" | tr ' ' '\n' | sed '/ami.*/d' | sed '/aws/d')
formats+=" ami ami_vmdk"
if printf "%s\n" $formats | grep -q '^ami\|^aws'; then
formats=$(grep -v '^ami\|^aws' <<< "${formats}")
printf -v formats "%s\n" ${formats} ami ami_vmdk
fi
for format in ${formats}; do

View File

@ -80,14 +80,14 @@ function _vm_build_impl() {
apply_local_patches
# Convert platform names (also used to find the test scripts) to image formats they entail
formats="$*"
if echo "$formats" | tr ' ' '\n' | grep -q '^vmware'; then
formats=$(echo "$formats" | tr ' ' '\n' | sed '/vmware.*/d')
formats+=" vmware vmware_ova vmware_raw"
printf -v formats "%s\n" ${formats}
if grep -q '^vmware' <<< "${formats}"; then
formats=$(grep -v '^vmware' <<< "${formats}")
printf -v formats "%s\n" ${formats} vmware vmware_ova vmware_raw
fi
if echo "$formats" | tr ' ' '\n' | grep -q -P '^(ami|aws)'; then
formats=$(echo "$formats" | tr ' ' '\n' | sed '/ami.*/d' | sed '/aws/d')
formats+=" ami ami_vmdk"
if printf "%s\n" $formats | grep -q '^ami\|^aws'; then
formats=$(grep -v '^ami\|^aws' <<< "${formats}")
printf -v formats "%s\n" ${formats} ami ami_vmdk
fi
source sdk_lib/sdk_container_common.sh