Merge "Don't assume _soong_config_namespaces_key is present" am: 8a7e9afc54
Original change: https://android-review.googlesource.com/c/platform/build/+/1892960 Change-Id: Ie81e7e2bf625b3b3540fad9c4dd66203185da91f
This commit is contained in:
@@ -30,7 +30,6 @@ def _init_globals(version_info):
|
||||
globals[k] = getattr(rblf_cli, k)
|
||||
|
||||
globals.setdefault("PRODUCT_SOONG_NAMESPACES", [])
|
||||
globals.setdefault(_soong_config_namespaces_key, {})
|
||||
_envsetup_init(globals, version_info)
|
||||
|
||||
# Variables that should be defined.
|
||||
@@ -299,10 +298,11 @@ def _indirect(pcm_name):
|
||||
def _soong_config_namespace(g, nsname):
|
||||
"""Adds given namespace if it does not exist."""
|
||||
|
||||
if g[_soong_config_namespaces_key].get(nsname):
|
||||
old = g.get(_soong_config_namespaces_key, {})
|
||||
if old.get(nsname):
|
||||
return
|
||||
|
||||
# A value cannot be updated, so we need to create a new dictionary
|
||||
old = g[_soong_config_namespaces_key]
|
||||
g[_soong_config_namespaces_key] = dict([(k,v) for k,v in old.items()] + [(nsname, {})])
|
||||
|
||||
def _soong_config_set(g, nsname, var, value):
|
||||
|
Reference in New Issue
Block a user