Merge "Don't assume _soong_config_namespaces_key is present"
This commit is contained in:
@@ -30,7 +30,6 @@ def _init_globals(version_info):
|
|||||||
globals[k] = getattr(rblf_cli, k)
|
globals[k] = getattr(rblf_cli, k)
|
||||||
|
|
||||||
globals.setdefault("PRODUCT_SOONG_NAMESPACES", [])
|
globals.setdefault("PRODUCT_SOONG_NAMESPACES", [])
|
||||||
globals.setdefault(_soong_config_namespaces_key, {})
|
|
||||||
_envsetup_init(globals, version_info)
|
_envsetup_init(globals, version_info)
|
||||||
|
|
||||||
# Variables that should be defined.
|
# Variables that should be defined.
|
||||||
@@ -299,10 +298,11 @@ def _indirect(pcm_name):
|
|||||||
def _soong_config_namespace(g, nsname):
|
def _soong_config_namespace(g, nsname):
|
||||||
"""Adds given namespace if it does not exist."""
|
"""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
|
return
|
||||||
|
|
||||||
# A value cannot be updated, so we need to create a new dictionary
|
# 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, {})])
|
g[_soong_config_namespaces_key] = dict([(k,v) for k,v in old.items()] + [(nsname, {})])
|
||||||
|
|
||||||
def _soong_config_set(g, nsname, var, value):
|
def _soong_config_set(g, nsname, var, value):
|
||||||
|
Reference in New Issue
Block a user