Exclude deprecated variables from dump-variables-rbc
This is to not show a warning when running the RBC product
config.
Bug: 226622262
Test: Manually
Change-Id: I69265c9d0dd475ada670e26295bdf27dfa407706
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 8f70e57..62ea1b6 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -325,9 +325,17 @@
# instead of the raw variable values, because mk2rbc can't read the
# raw ones.
define dump-variables-rbc
-$(file >$(OUT_DIR)/dump-variables-rbc-temp.txt,$(subst $(space),$(newline),$(.VARIABLES)))\
+$(eval _dump_variables_rbc_excluded := \
+ LOCAL_PATH \
+ TOPDIR \
+ TRACE_BEGIN_SOONG \
+ BOARD_PLAT_PUBLIC_SEPOLICY_DIR \
+ BOARD_PLAT_PRIVATE_SEPOLICY_DIR \
+ USER \
+ SOONG_% \
+ PRODUCT_COPY_OUT_%)\
$(file >$(1),\
-$(foreach v, $(shell grep -he "^[A-Z][A-Z0-9_]*$$" $(OUT_DIR)/dump-variables-rbc-temp.txt | grep -vhE "^(SOONG_.*|LOCAL_PATH|TOPDIR|PRODUCT_COPY_OUT_.*|TRACE_BEGIN_SOONG)$$"),\
+$(foreach v, $(shell echo $(filter-out $(_dump_variables_rbc_excluded),$(.VARIABLES)) | tr ' ' '\n' | grep -he "^[A-Z][A-Z0-9_]*$$"),\
$(v) := $(strip $($(v)))$(newline))\
$(foreach ns,$(SOONG_CONFIG_NAMESPACES),\
$(foreach v,$(SOONG_CONFIG_$(ns)),\