summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-09-02 14:29:38 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-05 20:25:41 +0100
commit9a6739879191c8b215e4fbce53e2d4c8d278d71a (patch)
tree4779b701781006492cba04b1d0e0f979fc18e64e /bitbake/lib
parent7d3d3e90003eaec1009331e357fb579b22fd6e9d (diff)
downloadast2050-yocto-poky-9a6739879191c8b215e4fbce53e2d4c8d278d71a.zip
ast2050-yocto-poky-9a6739879191c8b215e4fbce53e2d4c8d278d71a.tar.gz
hob: add a test to ensure hob is run with the required pre and post files
hob requires pre and post configuration files to store configuration values in, whilst this should (and will) be fixed long-term for so long as we require these files we should alert the user should they run without them. Fixes [YOCTO #1383] (Bitbake rev: bb3e9113074ea1254aa03a247a1a1070682df9c8) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/ui/hob.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index 022d1b6..3b0cacc 100644
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -982,6 +982,27 @@ class MainWindow (gtk.Window):
def main (server, eventHandler):
gobject.threads_init()
+ # NOTE: For now we require that the user run with pre and post files to
+ # read and store configuration set in the GUI.
+ # We hope to adjust this long term as tracked in Yocto Bugzilla #1441
+ # http://bugzilla.pokylinux.org/show_bug.cgi?id=1441
+ reqfiles = 0
+ dep_files = server.runCommand(["getVariable", "__depends"]) or set()
+ dep_files.union(server.runCommand(["getVariable", "__base_depends"]) or set())
+ for f in dep_files:
+ if f[0].endswith("hob-pre.conf"):
+ reqfiles = reqfiles + 1
+ elif f[0].endswith("hob-post.conf"):
+ reqfiles = reqfiles + 1
+ if reqfiles == 2:
+ break
+ if reqfiles < 2:
+ print("""The hob UI requires a pre file named hob-pre.conf and a post
+file named hob-post.conf to store and read its configuration from. Please run
+hob with these files, i.e.\n
+\bitbake -u hob -r conf/hob-pre.conf -R conf/hob-post.conf""")
+ return
+
taskmodel = TaskListModel()
configurator = Configurator()
handler = HobHandler(taskmodel, server)
OpenPOWER on IntegriCloud