diff options
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): | |||
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 | ||
237 | def export_vars(d): | 237 | def 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 | |||
242 | def 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 | ||
251 | def 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 | ||
257 | def emit_func(func, o=sys.__stdout__, d = init()): | 252 | def 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.""" |