From ed8c248ec096fad1c3c3171a38e8ed7d8de867bd Mon Sep 17 00:00:00 2001 From: Matt Mower Date: Mon, 2 Jan 2017 02:26:01 -0600 Subject: [PATCH] envsetup: Fix check for deprecated CM device tree By the time lunch is run on a product name, it's too late to check whether a deprecated CM device tree is being used (roomservice runs in lunch). Instead, rely on check_product() to identify whether a tree uses cm_ or lineage_ before running lunch. Change-Id: I16288365f791ff68c3226f3808427168b2fc06fa --- build/envsetup.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/envsetup.sh b/build/envsetup.sh index 22a6f6dc..3adae2e4 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -63,11 +63,12 @@ function breakfast() if [ -z "$variant" ]; then variant="userdebug" fi - lunch lineage_$target-$variant - if [ $? -ne 0 ]; then - # try CM + + if ! check_product lineage_$target && check_product cm_$target; then echo "** Warning: '$target' is using CM-based makefiles. This will be deprecated in the next major release." lunch cm_$target-$variant + else + lunch lineage_$target-$variant fi fi fi