Syntax expansion bugfix for linting suggestion

Fix to use '$$' instead of '$' for proper variable expansion.

Add check to fail build if list is empty.

Change-Id: Ia86f789e49538fff02c56f63079aef4eb3f01b5d
This commit is contained in:
Anderson, Craig (ca846m) 2021-04-06 13:23:27 -07:00
parent b2fddf30fd
commit 3628175efc

View File

@ -113,7 +113,11 @@ ifeq ($(IMAGE_TYPE), iso)
else
# Assemble all images based on configs defined in each subdirectory
# Trailing / allows proper function with symlinks
iterDirs="$(find $(QCOW_BUNDLE)/ -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)"
iterDirs="$$(find $(QCOW_BUNDLE)/ -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)"
if [[ -z $$iterDirs ]]; then
echo "Could not find any qcow images defined for bundle - exiting."
exit 1
fi
for subdir in $$iterDirs; do
# QCOW configs
export osconfig_params="$(QCOW_BUNDLE)/$$subdir/osconfig-vars.yaml"
@ -137,8 +141,12 @@ ifneq ($(QCOW_BUNDLE_DIRS), )
else
# Assemble all images based on configs defined in each $(IMAGE_TYPE)* subdirectory
# Trailing / allows proper function with symlinks
bundleDirs="$(find $(WORKDIR)/ -maxdepth 1 -mindepth 1 -name "qcow-bundle*" -type d -exec basename {} \;)"
bundleDirs="$$(find $(WORKDIR)/ -maxdepth 1 -mindepth 1 -name "qcow-bundle*" -type d -exec basename {} \;)"
endif
if [[ -z $$bundleDirs ]]; then
echo "Could not find any qcow bundle directories - exiting."
exit 1
fi
for bundledir in $$bundleDirs; do
export QCOW_BUNDLE="$(WORKDIR)/$$bundledir"
sudo -E make cut_image