From cfe5c92251694430d88ce17e43c482d6e96f4fb6 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Thu, 18 Mar 2021 11:40:23 -0500 Subject: [PATCH] Fix error building images without extra pkgs The extra pkg change broke image builds that don't use it because it was unconditionally calling realpath on the variable. If it wasn't set then this resulted in an invalid command. To fix this we just need to move the realpath call inside the -n check so we only do it if the variable is populated. --- 04_setup_ironic.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04_setup_ironic.sh b/04_setup_ironic.sh index 3c50be8f0..504a07b70 100755 --- a/04_setup_ironic.sh +++ b/04_setup_ironic.sh @@ -73,8 +73,8 @@ for IMAGE_VAR in $(env | grep "_LOCAL_IMAGE=" | grep -o "^[^=]*") ; do # file containing the packages (one per line) we want to install EXTRA_PKGS_FILE_PATH=${IMAGE_VAR/_LOCAL_IMAGE}_EXTRA_PACKAGES EXTRA_PKGS_FILE=${!EXTRA_PKGS_FILE_PATH:-} - EXTRA_PKGS_FILE=$(cd $OLDPWD; realpath $EXTRA_PKGS_FILE) if [[ -n $EXTRA_PKGS_FILE ]]; then + EXTRA_PKGS_FILE=$(cd $OLDPWD; realpath $EXTRA_PKGS_FILE) cp $EXTRA_PKGS_FILE "$REPOPATH" EXTRA_PKGS_FILE_NAME=$(basename $EXTRA_PKGS_FILE) BUILD_COMMAND_ARGS+=" --build-arg EXTRA_PKGS_LIST=$EXTRA_PKGS_FILE_NAME"