Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1200)

Unified Diff: build/android/envsetup.sh

Issue 10409048: validate CHROME_SRC setting to avoid confusion (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/envsetup.sh
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh
index 6ed168de6aa7e5d306736d3d884406a822f445e4..792a5f4753919fd5e64478e8deed93e2bc015562 100755
--- a/build/android/envsetup.sh
+++ b/build/android/envsetup.sh
@@ -91,9 +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}
+PWD=$(readlink -f .)
John Grabowski 2012/05/25 02:19:28 The shell sets $PWD so I don't think you want to o
Wei James(wistoch) 2012/05/25 02:53:24 yes. fixed. thanks
+
if [ -z "${CHROME_SRC}" ]; then
# If $CHROME_SRC was not set, assume current directory is CHROME_SRC.
- export CHROME_SRC=$(readlink -f .)
+ export CHROME_SRC="${PWD}"
+fi
+
+if [ "${PWD/"${CHROME_SRC}"/}" == "${PWD}" ]; then
John Grabowski 2012/05/25 02:19:28 Add comment explaining motivation
Wei James(wistoch) 2012/05/25 02:53:24 fixed. thanks
+ echo "Warning: Current directory is out of CHROME_SRC, it may not be \
+the one you want."
+ echo "${CHROME_SRC}"
fi
if [ ! -d "${CHROME_SRC}" ]; then
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698