Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2257427 authored by Brian Carlstrom's avatar Brian Carlstrom
Browse files

Use $OUT_DIR/filelist when OUT_DIR is set

Change-Id: Iadf3f05e752d71371d3d74e670ade3e937b1cd92
parent 5e858e3d
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -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