From bfe764478c651c833a40ece0ef362eb3c2827aa3 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Wed, 10 Oct 2018 06:10:34 +0200 Subject: ptxdist: fix PTXDIST_TOPDIR as explicit last layer If PTXdist is an explicit last layer, then it is often a symlink. PTXDIST_TOPDIR is always resolved with 'realpath', so do the same when setting up the layers. Make sure that the last path in PTXDIST_LAYERS is exactly PTXDIST_TOPDIR. This is needed used in other places (e.g. ptxd_kconfig_update()). This also fixes calling ptxdist from PTXDIST_TOPDIR when $PWD != `realpath $PWD`. Signed-off-by: Michael Olbrich --- bin/ptxdist | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bin/ptxdist') diff --git a/bin/ptxdist b/bin/ptxdist index fd3258a49..d063e3a33 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -1344,18 +1344,19 @@ setup_layers() exit 1 fi if [ -z "${PTXDIST_AUTOVERSION}" -a -e "${layer}/bin/ptxdist" -a \ - "${layer}" != "${PTXDIST_TOPDIR}" ]; then + "$(realpath "${layer}")" != "${PTXDIST_TOPDIR}" ]; then echo echo "${PTXDIST_LOG_PROMPT}error: PTXdist layer '${layer}' does not match the current PTXDIST_TOPDIR='${PTXDIST_TOPDIR}'" echo exit 1 fi + if [ "$(realpath "${layer}")" = "${PTXDIST_TOPDIR}" ]; then + break + fi PTXDIST_LAYERS[${#PTXDIST_LAYERS[@]}]="${layer}" layer="${layer}/base" done - if [ "${PTXDIST_LAYERS[(${#PTXDIST_LAYERS[@]}-1)]}" != "${PTXDIST_TOPDIR}" ]; then - PTXDIST_LAYERS[${#PTXDIST_LAYERS[@]}]="${PTXDIST_TOPDIR}" - fi + PTXDIST_LAYERS[${#PTXDIST_LAYERS[@]}]="${PTXDIST_TOPDIR}" if [ "${PTX_ptxconfig_SET}" = "false" ]; then local -a cfgs=( "selected_ptxconfig" "configs/ptxconfig" ) -- cgit v1.2.3