diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-08 20:16:56 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-08 20:38:28 +0100 |
commit | c7f76a1bc9868ea4709688967d9794acd4d784ec (patch) | |
tree | 0599fe8923b2dc0a89853b03b4eb17b836bacc54 /bitbake/lib/bb/data.py | |
parent | bdab8e93543bfc0d7b07c61da043b410036ac2c7 (diff) | |
download | openembedded-core-contrib-c7f76a1bc9868ea4709688967d9794acd4d784ec.tar.gz |
bitbake/data/runqueue: Sync up with upstream to clean up environment variable handling
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r-- | bitbake/lib/bb/data.py | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 50f2218a70..720dd76ef6 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py @@ -234,25 +234,20 @@ def emit_env(o=sys.__stdout__, d = init(), all=False): for key in keys: emit_var(key, o, d, all and not isfunc) and o.write('\n') -def export_vars(d): - keys = (key for key in d.keys() if d.getVarFlag(key, "export")) - ret = {} - for k in keys: +def exported_keys(d): + return (key for key in d.keys() if not key.startswith('__') and + d.getVarFlag(key, 'export') and + not d.getVarFlag(key, 'unexport')) + +def exported_vars(d): + for key in exported_keys(d): try: - v = d.getVar(k, True) - if v: - ret[k] = v - except (KeyboardInterrupt, bb.build.FuncFailed): - raise - except Exception, exc: + value = d.getVar(key, True) + except Exception: pass - return ret -def export_envvars(v, d): - for s in os.environ.keys(): - if s not in v: - v[s] = os.environ[s] - return v + if value is not None: + yield key, str(value) def emit_func(func, o=sys.__stdout__, d = init()): """Emits all items in the data store in a format such that it can be sourced by a shell.""" |