Clear TARGET_PRODUCT and TARGET_BUILD_VARIANT when getting lunch menu

An old TARGET_PRODUCT value pointing to a removed product or an invalid
TARGET_BUILD_VARIANT value cause lunch to fail to read
COMMON_LUNCH_CHOICES, clear them before calling into the build with
get_build_var.

Test: TARGET_PRODUCT=foobar TARGET_BUILD_VARIANT=foobar lunch
Change-Id: I53d205784149ba7e32cc093f9d81d1a82c08bfc0
This commit is contained in:
Colin Cross 2021-04-22 13:05:41 -07:00
parent 37b11b8cfb
commit fa50d406bb

View file

@ -608,7 +608,7 @@ function print_lunch_menu()
{
local uname=$(uname)
local choices
choices=$(TARGET_BUILD_APPS= get_build_var COMMON_LUNCH_CHOICES 2>/dev/null)
choices=$(TARGET_BUILD_APPS= TARGET_PRODUCT= TARGET_BUILD_VARIANT= get_build_var COMMON_LUNCH_CHOICES 2>/dev/null)
local ret=$?
echo