summaryrefslogtreecommitdiffstats
path: root/build/android/envsetup.sh
diff options
context:
space:
mode:
authorskyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-11 10:23:52 +0000
committerskyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-11 10:23:52 +0000
commit1c898c96ce38e1fa05d87bbd0c31c33fc2adad05 (patch)
tree60599ac49fa22def33ae04c71486fd20f5d10c3f /build/android/envsetup.sh
parent1e4cd647916a25dc431c780fa35a6d28db4a7da7 (diff)
downloadchromium_src-1c898c96ce38e1fa05d87bbd0c31c33fc2adad05.zip
chromium_src-1c898c96ce38e1fa05d87bbd0c31c33fc2adad05.tar.gz
chromium_src-1c898c96ce38e1fa05d87bbd0c31c33fc2adad05.tar.bz2
Canonicalize CHROME_SRC variable on Android
If $PWD contains a symlink, build/android/envsetup.sh ends up setting CHROME_SRC to the same symlinked path. This breaks some utilities (e.g., grit) that work with absolute paths and expect them to be prefixed by CHROME_SRC. The fix is to set CHROME_SRC to the canonical absolute path of the current directory. BUG= TEST=cd $SYMLINKED_PATH; unset CHROME_SRC; . build/android/envsetup.sh; android_gyp Review URL: https://chromiumcodereview.appspot.com/10700141 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146097 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android/envsetup.sh')
-rwxr-xr-xbuild/android/envsetup.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh
index f7ef621..4a3f9fb 100755
--- a/build/android/envsetup.sh
+++ b/build/android/envsetup.sh
@@ -91,16 +91,17 @@ export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools
# Must have tools like arm-linux-androideabi-gcc on the path for ninja
export PATH=$PATH:${ANDROID_TOOLCHAIN}
+CURRENT_DIR="$(readlink -f ${PWD})"
if [ -z "${CHROME_SRC}" ]; then
# If $CHROME_SRC was not set, assume current directory is CHROME_SRC.
- export CHROME_SRC="${PWD}"
+ export CHROME_SRC="${CURRENT_DIR}"
fi
-if [ "${PWD/"${CHROME_SRC}"/}" == "${PWD}" ]; then
+if [ "${CURRENT_DIR/"${CHROME_SRC}"/}" == "${CURRENT_DIR}" ]; then
# If current directory is not in $CHROME_SRC, it might be set for other
# source tree. If $CHROME_SRC was set correctly and we are in the correct
- # directory, "${PWD/"${CHROME_SRC}"/}" will be "".
- # Otherwise, it will equal to "${PWD}"
+ # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "".
+ # Otherwise, it will equal to "${CURRENT_DIR}"
echo "Warning: Current directory is out of CHROME_SRC, it may not be \
the one you want."
echo "${CHROME_SRC}"