Skip to content

Commit

Permalink
Fix error building images without extra pkgs (#1201)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cybertron authored Mar 19, 2021
1 parent e6779bc commit 1d3b88e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 04_setup_ironic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1d3b88e

Please sign in to comment.