summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley Sepos <[email protected]>2019-09-22 15:22:28 -0400
committerBradley Sepos <[email protected]>2019-09-22 15:23:06 -0400
commit86e0173ec1b3c953e7a1100684caabc095e91edc (patch)
treea04aef78f060791512e7acfc952f40d0945afa7f
parentb4342abace9eb44437f1a749107ae1f15ab2149a (diff)
make: Further unclobber Xcode PATH in xcodemake.
Fixes #2216.
-rwxr-xr-xmake/xcodemake26
1 files changed, 24 insertions, 2 deletions
diff --git a/make/xcodemake b/make/xcodemake
index b627a83ad..3ea3d02ec 100755
--- a/make/xcodemake
+++ b/make/xcodemake
@@ -92,7 +92,11 @@ elif [ "$EXTERNAL_SRC/make/configure.py" -nt "$EXTERNAL_BUILD/GNUmakefile" ]; th
reconfigure="configure script was updated"
elif [ "$EXTERNAL_DRIVER" == "bootstrap" ]; then
reconfigure="driver bootstrap"
-elif [ "${PATH#$SYSTEM_DEVELOPER_BIN_DIR}" != "${PATH}" ]; then
+elif [[ "${PATH}" == "${DEVELOPER_BIN_DIR%/bin}"* ]] ||
+ [[ "${PATH}" == "${DT_TOOLCHAIN_DIR%/bin}"* ]] ||
+ [[ "${PATH}" == "${PLATFORM_DIR%/bin}"* ]] ||
+ [[ "${PATH}" == "${PLATFORM_DEVELOPER_BIN_DIR%/bin}"* ]] ||
+ [[ "${PATH}" == "${SYSTEM_DEVELOPER_BIN_DIR%/bin}"* ]]; then
reconfigure="unclobber PATH"
else
reconfigure=
@@ -103,7 +107,25 @@ if [ -n "$reconfigure" ]; then
echo "reconfiguring ($reconfigure)"
## respect PATH priority
- export PATH="${PATH#$SYSTEM_DEVELOPER_BIN_DIR:}:${SYSTEM_DEVELOPER_BIN_DIR}"
+ OIFS="${IFS}"
+ IFS=':'
+ read -r -a PATH_ITEMS <<< "${PATH}"
+ IFS="${OIFS}"
+ PATH=""
+ APPLE_PATH=""
+ for ITEM in "${PATH_ITEMS[@]}"; do
+ if [[ "${ITEM}" == "${DEVELOPER_BIN_DIR%/bin}"* ]] ||
+ [[ "${ITEM}" == "${DT_TOOLCHAIN_DIR%/bin}"* ]] ||
+ [[ "${ITEM}" == "${PLATFORM_DIR%/bin}"* ]] ||
+ [[ "${ITEM}" == "${PLATFORM_DEVELOPER_BIN_DIR%/bin}"* ]] ||
+ [[ "${ITEM}" == "${SYSTEM_DEVELOPER_BIN_DIR%/bin}"* ]]; then
+ APPLE_PATH="${APPLE_PATH}:${ITEM}"
+ else
+ PATH="${PATH}:${ITEM}"
+ fi
+ done
+ PATH="${PATH}${APPLE_PATH}"
+ export PATH="${PATH:2}"
echo "Unclobbering PATH:"
echo " export PATH=\"${PATH}\""