summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/hob.py
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-30 12:19:15 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-02 22:31:44 +0100
commit8c4598a532991424eba401d8b7711ea8b45c27f3 (patch)
tree751621b7e5d9b5d2b4a271f026ab68fbc79116f8 /bitbake/lib/bb/ui/hob.py
parente03114b3521cbefa2c8bafa4bbf2dc4661793c31 (diff)
downloadast2050-yocto-poky-8c4598a532991424eba401d8b7711ea8b45c27f3.zip
ast2050-yocto-poky-8c4598a532991424eba401d8b7711ea8b45c27f3.tar.gz
hob: remove temporary directory on program shutdown
Move temp directory handling into the HobEventHandler and clean up the temporary files on program close. Fixes [YOCTO #1307] (Bitbake rev: 1009ca570a750a00b0e60afcc30ead070c7b310a) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/hob.py')
-rw-r--r--bitbake/lib/bb/ui/hob.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index 919c06e..b5c2342 100644
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -114,6 +114,8 @@ class MainWindow (gtk.Window):
# whilst the busy cursor is set
self.set_busy_cursor(False)
+ self.handler.remove_temp_dir()
+
gtk.main_quit()
"""
@@ -418,13 +420,10 @@ class MainWindow (gtk.Window):
rep.base_image = "empty"
if build_image:
- import tempfile, datetime
-
- image_name = "hob-%s-variant-%s" % (rep.base_image, datetime.date.today().isoformat())
- image_file = "%s.bb" % (image_name)
- image_dir = os.path.join(tempfile.gettempdir(), 'hob-images')
- bb.utils.mkdirhier(image_dir)
- recipepath = os.path.join(image_dir, image_file)
+ self.handler.make_temp_dir()
+ recipepath = self.handler.get_temp_recipe_path(rep.base_image)
+ image_name = recipepath.rstrip(".bb")
+ path, sep, image_name = image_name.rpartition("/")
rep.writeRecipe(recipepath, self.model)
# In the case where we saved the file for the purpose of building
@@ -433,7 +432,7 @@ class MainWindow (gtk.Window):
if not self.save_path:
self.files_to_clean.append(recipepath)
- self.handler.build_image(image_name, image_dir, self.configurator)
+ self.handler.build_image(image_name, self.configurator)
else:
self.handler.build_packages(rep.allpkgs.split(" "))
OpenPOWER on IntegriCloud