aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2015-10-04 19:40:41 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-04 19:40:41 +0000
commitf73f79f1b63c7cb7679264a6c6e4f86fdd78309c (patch)
tree743a0cfb3df47790c9dd31174a3fbf0e840aa570
parent393c62549a6340b3473f14b71d583e118d7e6a6d (diff)
parentf2257427d9b2635e9bafbf94043f5f17d4192207 (diff)
downloadbuild-f73f79f1b63c7cb7679264a6c6e4f86fdd78309c.tar.gz
Merge "Use $OUT_DIR/filelist when OUT_DIR is set" into mnc-dev
-rw-r--r--envsetup.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/envsetup.sh b/envsetup.sh
index dba64ee974..6ad3a9e80c 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1355,14 +1355,20 @@ function godir () {
return
fi
T=$(gettop)
- if [[ ! -f $T/filelist ]]; then
+ if [ ! "$OUT_DIR" = "" ]; then
+ mkdir -p $OUT_DIR
+ FILELIST=$OUT_DIR/filelist
+ else
+ FILELIST=$T/filelist
+ fi
+ if [[ ! -f $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
local lines
- lines=($(\grep "$1" $T/filelist | sed -e 's/\/[^/]*$//' | sort | uniq))
+ lines=($(\grep "$1" $FILELIST | sed -e 's/\/[^/]*$//' | sort | uniq))
if [[ ${#lines[@]} = 0 ]]; then
echo "Not found"
return