am f73f79f1: Merge "Use /filelist when OUT_DIR is set" into mnc-dev

* commit 'f73f79f1b63c7cb7679264a6c6e4f86fdd78309c':
  Use $OUT_DIR/filelist when OUT_DIR is set
This commit is contained in:
Brian Carlstrom 2015-10-04 19:47:22 +00:00 committed by Android Git Automerger
commit fa2ce3b38b
1 changed files with 9 additions and 3 deletions

View File

@ -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