All of lore.kernel.org
 help / color / mirror / Atom feed
* runqueue: Ensure task environment is correct
@ 2011-09-07 17:43 Richard Purdie
  2011-09-07 18:38 ` Chris Larson
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2011-09-07 17:43 UTC (permalink / raw)
  To: bitbake-devel

This fixes two problems:

a) Variables which were in the parent environment but not set as "export"
   variables in the datastore could end up in the task environment

b) oe.environ.update() can't cope with the generator returned by 
   bb.data.exported_vars()

Whilst the updated code isn't as neat, it does do the expected thing,
sets the environment correctly and stops unwanted values leaking into
the task environment.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 5a4321f..72e6845 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1136,7 +1136,12 @@ class RunQueueExecute:
                 for h in self.rqdata.hash_deps:
                     the_data.setVar("BBHASHDEPS_%s" % h, self.rqdata.hash_deps[h])
 
-                os.environ.update(bb.data.exported_vars(the_data))
+                # exported_vars() returns a generator which *cannot* be passed to os.environ.update() 
+                # successfully. We also need to unset anything from the environment which shouldn't be there 
+                exports = bb.data.exported_vars(the_data)
+                bb.utils.empty_environment()
+                for e, v in exports:
+                    os.environ[e] = v
 
                 if quieterrors:
                     the_data.setVarFlag(taskname, "quieterrors", "1")




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-07 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-07 17:43 runqueue: Ensure task environment is correct Richard Purdie
2011-09-07 18:38 ` Chris Larson
2011-09-07 21:11   ` Richard Purdie
2011-09-07 21:43     ` Chris Larson
2011-09-07 22:10       ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.