From 5146fd985414e187165eda402a290fdded231f87 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Mon, 9 Sep 2024 08:34:41 +0300 Subject: [PATCH] build: Import check_product from lineage-21.0 build/make Change-Id: I6cb2856bbc15bc25fc3ad6a4c1a6aa6aa56057f1 --- build/envsetup.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/build/envsetup.sh b/build/envsetup.sh index 973aaef4..1bb5d5ad 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -27,6 +27,30 @@ function mk_timer() return $ret } +# check to see if the supplied product is one we can build +function check_product() +{ + local T=$(gettop) + if [ ! "$T" ]; then + echo "Couldn't locate the top of the tree. Try setting TOP." >&2 + return + fi + if (echo -n $1 | grep -q -e "^tequila_") ; then + TEQUILA_BUILD=$(echo -n $1 | sed -e 's/^tequila_//g') + else + TEQUILA_BUILD= + fi + export TEQUILA_BUILD + + TARGET_PRODUCT=$1 \ + TARGET_RELEASE=$2 \ + TARGET_BUILD_VARIANT= \ + TARGET_BUILD_TYPE= \ + TARGET_BUILD_APPS= \ + get_build_var TARGET_DEVICE > /dev/null + # hide successful answers, but allow the errors to show +} + function brunch() { breakfast $*