summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-08 20:16:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-08 20:38:28 +0100
commitc7f76a1bc9868ea4709688967d9794acd4d784ec (patch)
tree0599fe8923b2dc0a89853b03b4eb17b836bacc54 /bitbake/lib/bb/data.py
parentbdab8e93543bfc0d7b07c61da043b410036ac2c7 (diff)
downloadpoky-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.py27
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):
234 for key in keys: 234 for key in keys:
235 emit_var(key, o, d, all and not isfunc) and o.write('\n') 235 emit_var(key, o, d, all and not isfunc) and o.write('\n')
236 236
237def export_vars(d): 237def exported_keys(d):
238 keys = (key for key in d.keys() if d.getVarFlag(key, "export")) 238 return (key for key in d.keys() if not key.startswith('__') and
239 ret = {} 239 d.getVarFlag(key, 'export') and
240 for k in keys: 240 not d.getVarFlag(key, 'unexport'))
241
242def exported_vars(d):
243 for key in exported_keys(d):
241 try: 244 try:
242 v = d.getVar(k, True) 245 value = d.getVar(key, True)
243 if v: 246 except Exception:
244 ret[k] = v
245 except (KeyboardInterrupt, bb.build.FuncFailed):
246 raise
247 except Exception, exc:
248 pass 247 pass
249 return ret
250 248
251def export_envvars(v, d): 249 if value is not None:
252 for s in os.environ.keys(): 250 yield key, str(value)
253 if s not in v:
254 v[s] = os.environ[s]
255 return v
256 251
257def emit_func(func, o=sys.__stdout__, d = init()): 252def emit_func(func, o=sys.__stdout__, d = init()):
258 """Emits all items in the data store in a format such that it can be sourced by a shell.""" 253 """Emits all items in the data store in a format such that it can be sourced by a shell."""