Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e16def09 authored by Cole Faust's avatar Cole Faust
Browse files

Remove duplicates from VendorVars maps

Some products access the SOONG_CONFIG variables
directly, instead of using soong_config_set. When
they do that, they could end up with duplicate values
in those variables, causing duplicate keys to be
generated in a json map.

Use $(sort) to dedup the map keys before writing them
out.

Bug: 249685973
Test: Presubmits
Change-Id: If0c16377bdfbd3f836ebec9262bec7cf562f339c
parent 89a9f55d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -249,9 +249,9 @@ $(call add_json_list, TargetFSConfigGen, $(TARGET_FS_CONFIG_GEN)
$(call add_json_list, MissingUsesLibraries,              $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES))

$(call add_json_map, VendorVars)
$(foreach namespace,$(SOONG_CONFIG_NAMESPACES),\
$(foreach namespace,$(sort $(SOONG_CONFIG_NAMESPACES)),\
  $(call add_json_map, $(namespace))\
  $(foreach key,$(SOONG_CONFIG_$(namespace)),\
  $(foreach key,$(sort $(SOONG_CONFIG_$(namespace))),\
    $(call add_json_str,$(key),$(subst ",\",$(SOONG_CONFIG_$(namespace)_$(key)))))\
  $(call end_json_map))
$(call end_json_map)