diff options
Diffstat (limited to 'envsetup.sh')
-rw-r--r-- | envsetup.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/envsetup.sh b/envsetup.sh index 4ce7d3b..8eb22cf 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1625,14 +1625,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 |