diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-07-14 14:27:13 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-07-14 14:51:52 +0200 |
commit | bc00f56353272ce1074c132e2a1e27fde9256fae (patch) | |
tree | 3fab50431e0f585ffb2e22a66466838ff71238d7 | |
parent | 90619df00d665b0ecd59b1a954c69c7726cffe88 (diff) | |
download | ptxdist-bc00f56353272ce1074c132e2a1e27fde9256fae.tar.gz ptxdist-bc00f56353272ce1074c132e2a1e27fde9256fae.tar.xz |
ptxdist: handle symlinks correctly when comparing PTXDIST_TOPDIR and PTXDIST_WORKSPACE
PTXDIST_TOPDIR is set to based on the path to ptxdist with all symlinks
resolved. PTXDIST_WORKSPACE is set to the current working directory. If
this path contains symlinks then comparing the strings does not work as
expected.
Use '-ef' instead to check if both paths point to the same directory.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-x | bin/ptxdist | 2 | ||||
-rw-r--r-- | scripts/lib/ptxd_lib_00-init.sh | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 85c5a0197..6e04a7b96 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -1222,7 +1222,7 @@ create_docs() { builder="${1}" outdir=${PTXDIST_WORKSPACE}/Documentation - if [ "${PTXDIST_TOPDIR}" = "${PTXDIST_WORKSPACE}" ]; then + if [ "${PTXDIST_TOPDIR}" -ef "${PTXDIST_WORKSPACE}" ]; then srcdir="${PTXDIST_TEMPDIR}/docs" else srcdir="${STATEDIR}/docs" diff --git a/scripts/lib/ptxd_lib_00-init.sh b/scripts/lib/ptxd_lib_00-init.sh index 17ddae614..98a9261f8 100644 --- a/scripts/lib/ptxd_lib_00-init.sh +++ b/scripts/lib/ptxd_lib_00-init.sh @@ -51,7 +51,7 @@ ptxd_init_get_sysroot_base_platform() { ptxd_init_ptxdist_path() { if [ "${PTXDIST_WORKSPACE}" != "${PTXDIST_PLATFORMCONFIGDIR}" ]; then PTXDIST_PATH="${PTXDIST_WORKSPACE}:${PTXDIST_PLATFORMCONFIGDIR}:${PTXDIST_TOPDIR}:" - elif [ "${PTXDIST_WORKSPACE}" != "${PTXDIST_TOPDIR}" ]; then + elif [ ! "${PTXDIST_WORKSPACE}" -ef "${PTXDIST_TOPDIR}" ]; then PTXDIST_PATH="${PTXDIST_WORKSPACE}:${PTXDIST_TOPDIR}:" else PTXDIST_PATH="${PTXDIST_WORKSPACE}:" |