echo $TOP
else
if [ -f $TOPFILE ] ; then
- echo $PWD
+ # The following circumlocution (repeated below as well) ensures
+ # that we record the true directory name and not one that is
+ # 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
T=
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
cd .. > /dev/null
- T=$PWD
+ T=`PWD= /bin/pwd`
done
cd $HERE > /dev/null
if [ -f "$T/$TOPFILE" ]; then
if [ -f $DIR/Android.mk ]; then
TO_CHOP=`echo $T | wc -c | tr -d ' '`
TO_CHOP=`expr $TO_CHOP + 1`
- MFILE=`echo $PWD | cut -c${TO_CHOP}-`
+ START=`PWD= /bin/pwd`
+ MFILE=`echo $START | cut -c${TO_CHOP}-`
if [ "$MFILE" = "" ] ; then
MFILE=$DIR/Android.mk
else
echo "Usage: godir <regex>"
return
fi
+ T=$(gettop)
if [[ ! -f $T/filelist ]]; then
echo -n "Creating index..."
- (cd $T; find . -wholename ./out -prune -o -type f > filelist)
+ (cd $T; find . -wholename ./out -prune -o -wholename ./.repo -prune -o -type f > filelist)
echo " Done"
echo ""
fi