From 0c1374cc709389d6a21cf426ec93d1669e04e143 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Wed, 1 Apr 2015 10:13:02 -0700 Subject: [PATCH] Return non-zero if can't locate top of the tree in m/mm/mmm. Bug: 20017058 Change-Id: I85fac71061673d00a1b583ad13afc8567d794cd6 --- envsetup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/envsetup.sh b/envsetup.sh index f93c07d52..bd77895e0 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -672,6 +672,7 @@ function m() $DRV make -C $T -f build/core/main.mk $@ else echo "Couldn't locate the top of the tree. Try setting TOP." + return 1 fi } @@ -710,8 +711,10 @@ function mm() local M=`echo $M|sed 's:'$T'/::'` if [ ! "$T" ]; then echo "Couldn't locate the top of the tree. Try setting TOP." + return 1 elif [ ! "$M" ]; then echo "Couldn't locate a makefile from the current directory." + return 1 else for ARG in $@; do case $ARG in @@ -774,6 +777,7 @@ function mmm() ONE_SHOT_MAKEFILE="$MAKEFILE" $DRV make -C $T -f build/core/main.mk $DASH_ARGS $MODULES $ARGS else echo "Couldn't locate the top of the tree. Try setting TOP." + return 1 fi } @@ -786,6 +790,7 @@ function mma() else if [ ! "$T" ]; then echo "Couldn't locate the top of the tree. Try setting TOP." + return 1 fi local MY_PWD=`PWD= /bin/pwd|sed 's:'$T'/::'` $DRV make -C $T -f build/core/main.mk $@ all_modules BUILD_MODULES_IN_PATHS="$MY_PWD" @@ -825,6 +830,7 @@ function mmma() $DRV make -C $T -f build/core/main.mk $DASH_ARGS $ARGS all_modules BUILD_MODULES_IN_PATHS="$MODULE_PATHS" else echo "Couldn't locate the top of the tree. Try setting TOP." + return 1 fi }