summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2012-12-13 10:52:07 -0800
committerYing Wang <wangying@google.com>2012-12-13 10:52:56 -0800
commit9cd1764814541855e5d2ea6b093c6e7ff6febdef (patch)
tree0a8caeeb79d6b69a59c9df4cee317acc56c3cc54 /envsetup.sh
parent5ece4724d19712225d4fbb6d91d86619015d81b3 (diff)
downloadbuild-9cd1764814541855e5d2ea6b093c6e7ff6febdef.zip
build-9cd1764814541855e5d2ea6b093c6e7ff6febdef.tar.gz
build-9cd1764814541855e5d2ea6b093c6e7ff6febdef.tar.bz2
Use "\cd" to disable alias temporarily.
http://code.google.com/p/android/issues/detail?id=41372 Change-Id: I78e468cb5d57e51774d2e42376ef1f4b52096d33
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh37
1 files changed, 14 insertions, 23 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 3aeb52b..337282a 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -31,7 +31,7 @@ function get_abs_build_var()
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
fi
- (cd $T; CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
+ (\cd $T; CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1)
}
@@ -584,16 +584,13 @@ function gettop
# faked up with symlink names.
PWD= /bin/pwd
else
- # We redirect cd to /dev/null in case it's aliased to
- # a command that prints something as a side-effect
- # (like pushd)
local HERE=$PWD
T=
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
- cd .. > /dev/null
+ \cd ..
T=`PWD= /bin/pwd`
done
- cd $HERE > /dev/null
+ \cd $HERE
if [ -f "$T/$TOPFILE" ]; then
echo $T
fi
@@ -614,21 +611,18 @@ function m()
function findmakefile()
{
TOPFILE=build/core/envsetup.mk
- # We redirect cd to /dev/null in case it's aliased to
- # a command that prints something as a side-effect
- # (like pushd)
local HERE=$PWD
T=
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
T=`PWD= /bin/pwd`
if [ -f "$T/Android.mk" ]; then
echo $T/Android.mk
- cd $HERE > /dev/null
+ \cd $HERE
return
fi
- cd .. > /dev/null
+ \cd ..
done
- cd $HERE > /dev/null
+ \cd $HERE
}
function mm()
@@ -670,7 +664,7 @@ function mmm()
fi
DIR=`echo $DIR | sed -e 's/:.*//' -e 's:/$::'`
if [ -f $DIR/Android.mk ]; then
- TO_CHOP=`(cd -P -- $T && pwd -P) | wc -c | tr -d ' '`
+ TO_CHOP=`(\cd -P -- $T && pwd -P) | wc -c | tr -d ' '`
TO_CHOP=`expr $TO_CHOP + 1`
START=`PWD= /bin/pwd`
MFILE=`echo $START | cut -c${TO_CHOP}-`
@@ -705,7 +699,7 @@ function croot()
{
T=$(gettop)
if [ "$T" ]; then
- cd $(gettop)
+ \cd $(gettop)
else
echo "Couldn't locate the top of the tree. Try setting TOP."
fi
@@ -714,20 +708,17 @@ function croot()
function cproj()
{
TOPFILE=build/core/envsetup.mk
- # We redirect cd to /dev/null in case it's aliased to
- # a command that prints something as a side-effect
- # (like pushd)
local HERE=$PWD
T=
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
T=$PWD
if [ -f "$T/Android.mk" ]; then
- cd $T
+ \cd $T
return
fi
- cd .. > /dev/null
+ \cd ..
done
- cd $HERE > /dev/null
+ \cd $HERE
echo "can't find Android.mk"
}
@@ -1067,7 +1058,7 @@ function smoketest()
return
fi
- (cd "$T" && mmm tests/SmokeTest) &&
+ (\cd "$T" && mmm tests/SmokeTest) &&
adb uninstall com.android.smoketest > /dev/null &&
adb uninstall com.android.smoketest.tests > /dev/null &&
adb install $ANDROID_PRODUCT_OUT/data/app/SmokeTestApp.apk &&
@@ -1094,7 +1085,7 @@ function godir () {
T=$(gettop)
if [[ ! -f $T/filelist ]]; then
echo -n "Creating index..."
- (cd $T; find . -wholename ./out -prune -o -wholename ./.repo -prune -o -type f > filelist)
+ (\cd $T; find . -wholename ./out -prune -o -wholename ./.repo -prune -o -type f > filelist)
echo " Done"
echo ""
fi
@@ -1127,7 +1118,7 @@ function godir () {
else
pathname=${lines[0]}
fi
- cd $T/$pathname
+ \cd $T/$pathname
}
# Force JAVA_HOME to point to java 1.6 if it isn't already set