Patchwork [bitbake-devel,9/9] Hob: Avoid getting TMPDIR in hardcode

login
register
mail settings
Submitter Dongxiao Xu
Date March 24, 2012, 11:49 a.m.
Message ID <f8e0929d3af0994bf481f02405ac7481d23a59b6.1332589589.git.dongxiao.xu@intel.com>
Download mbox | patch
Permalink /patch/24481/
State Accepted
Commit 91bdd43468448385e07a57ac54ce25db9a8edf03
Headers show

Comments

Dongxiao Xu - March 24, 2012, 11:49 a.m.
We should get TMPDIR from bitbake server instead of hardcode.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/builder.py         |    3 ++-
 lib/bb/ui/crumbs/hobeventhandler.py |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

Patch

diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index 2984490..7b6c116 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -138,6 +138,7 @@  class Parameters:
         self.runnable_image_types = params["runnable_image_types"].split()
         self.runnable_machine_patterns = params["runnable_machine_patterns"].split()
         self.deployable_image_types = params["deployable_image_types"].split()
+        self.tmpdir = params["tmpdir"]
 
 class Builder(gtk.Window):
 
@@ -813,7 +814,7 @@  class Builder(gtk.Window):
 
         if response == gtk.RESPONSE_YES:
             source_env_path = os.path.join(self.parameters.core_base, "oe-init-build-env")
-            tmp_path = os.path.join(os.getcwd(), "tmp")
+            tmp_path = self.parameters.tmpdir
             if os.path.exists(image_path) and os.path.exists(kernel_path) \
                and os.path.exists(source_env_path) and os.path.exists(tmp_path):
                 cmdline = "/usr/bin/xterm -e "
diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index e342811..8042fbd 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -439,4 +439,5 @@  class HobHandler(gobject.GObject):
         params["runnable_image_types"] = self.server.runCommand(["getVariable", "RUNNABLE_IMAGE_TYPES"]) or ""
         params["runnable_machine_patterns"] = self.server.runCommand(["getVariable", "RUNNABLE_MACHINE_PATTERNS"]) or ""
         params["deployable_image_types"] = self.server.runCommand(["getVariable", "DEPLOYABLE_IMAGE_TYPES"]) or ""
+        params["tmpdir"] = self.server.runCommand(["getVariable", "TMPDIR"]) or ""
         return params