kas-container: Improve KAS_WORK/BUILD_DIR retrieval

Perform link resolution unconditionally to account for cases when the
default paths are links. Use default values to simplify the assignments.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2021-03-21 09:14:12 +01:00
parent 03da3f9436
commit 3f98520ab6

View File

@ -87,17 +87,8 @@ set_container_image_var() {
KAS_CONTAINER_IMAGE="${KAS_CONTAINER_IMAGE_PATH}/${KAS_CONTAINER_IMAGE_NAME}:${KAS_IMAGE_VERSION}"
}
if [ -n "${KAS_WORK_DIR}" ]; then
KAS_WORK_DIR=$(readlink -f "${KAS_WORK_DIR}")
else
KAS_WORK_DIR="$(pwd)"
fi
if [ -n "${KAS_BUILD_DIR}" ]; then
KAS_BUILD_DIR=$(readlink -f "${KAS_BUILD_DIR}")
else
KAS_BUILD_DIR="${KAS_WORK_DIR}/build"
fi
KAS_WORK_DIR=$(readlink -f "${KAS_WORK_DIR:-$(pwd)}")
KAS_BUILD_DIR=$(readlink -f "${KAS_BUILD_DIR:-${KAS_WORK_DIR}/build}")
KAS_CONTAINER_ENGINE="${KAS_CONTAINER_ENGINE:-${KAS_DOCKER_ENGINE}}"
if [ -z "${KAS_CONTAINER_ENGINE}" ]; then