diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-10-10 06:10:34 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-10-12 07:52:29 +0200 |
commit | bfe764478c651c833a40ece0ef362eb3c2827aa3 (patch) | |
tree | 6c0117fc3106b8a0ca8bd7d39a55c898190a5894 | |
parent | 477cdd08aeeeb965ce6b2a001b2c2cdfa9e63daa (diff) | |
download | ptxdist-bfe764478c651c833a40ece0ef362eb3c2827aa3.tar.gz ptxdist-bfe764478c651c833a40ece0ef362eb3c2827aa3.tar.xz |
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 <m.olbrich@pengutronix.de>
-rwxr-xr-x | bin/ptxdist | 9 |
1 files changed, 5 insertions, 4 deletions
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" ) |