summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-09-19 15:25:45 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-20 22:24:10 +0100
commit081990b2a3d27c83f17d79265d0c77271e9d6638 (patch)
tree16d67549a19232ce5363cf19873af6a6b41e84e6 /bitbake
parent8ebca0c5a85de618b82d1c0e2f526f9c75e3ae68 (diff)
downloadpoky-081990b2a3d27c83f17d79265d0c77271e9d6638.tar.gz
hob: fix build again when building packages only
The different code paths for package vs image builds have lead to some bit rot in the package only build and an incompatability between package only builds and the build again mechanism. This patch unifies the code paths and fixes build again for package only builds. Fixes [YOCTO #1480] (Bitbake rev: ab6c63f35739c30df0e8a9d0f1ae982b96e538ed) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py13
-rw-r--r--bitbake/lib/bb/ui/hob.py11
2 files changed, 12 insertions, 12 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 8bf599ff64..393b40707c 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -71,7 +71,7 @@ class HobHandler(gobject.GObject):
71 gobject.GObject.__init__(self) 71 gobject.GObject.__init__(self)
72 72
73 self.current_command = None 73 self.current_command = None
74 self.building = None 74 self.building = False
75 self.build_toolchain = False 75 self.build_toolchain = False
76 self.build_toolchain_headers = False 76 self.build_toolchain_headers = False
77 self.generating = False 77 self.generating = False
@@ -128,10 +128,10 @@ class HobHandler(gobject.GObject):
128 self.server.runCommand(["resetCooker"]) 128 self.server.runCommand(["resetCooker"])
129 self.server.runCommand(["reparseFiles"]) 129 self.server.runCommand(["reparseFiles"])
130 elif self.current_command == self.BUILD_IMAGE: 130 elif self.current_command == self.BUILD_IMAGE:
131 self.building = "image"
132 if self.generating: 131 if self.generating:
133 self.emit("data-generated") 132 self.emit("data-generated")
134 self.generating = False 133 self.generating = False
134 self.building = True
135 self.server.runCommand(["buildTargets", self.build_queue, "build"]) 135 self.server.runCommand(["buildTargets", self.build_queue, "build"])
136 self.build_queue = [] 136 self.build_queue = []
137 self.current_command = None 137 self.current_command = None
@@ -247,11 +247,12 @@ class HobHandler(gobject.GObject):
247 pmake = "-j %s" % threads 247 pmake = "-j %s" % threads
248 self.server.runCommand(["setVariable", "BB_NUMBER_THREADS", pmake]) 248 self.server.runCommand(["setVariable", "BB_NUMBER_THREADS", pmake])
249 249
250 def build_image(self, image, configurator): 250 def build_targets(self, tgts, configurator, build_type="image"):
251 self.build_type = build_type
251 targets = [] 252 targets = []
252 nbbp = None 253 nbbp = None
253 nbbf = None 254 nbbf = None
254 targets.append(image) 255 targets.extend(tgts)
255 if self.build_toolchain and self.build_toolchain_headers: 256 if self.build_toolchain and self.build_toolchain_headers:
256 targets.append("meta-toolchain-sdk") 257 targets.append("meta-toolchain-sdk")
257 elif self.build_toolchain: 258 elif self.build_toolchain:
@@ -284,10 +285,6 @@ class HobHandler(gobject.GObject):
284 self.current_command = self.REPARSE_FILES 285 self.current_command = self.REPARSE_FILES
285 self.run_next_command() 286 self.run_next_command()
286 287
287 def build_packages(self, pkgs):
288 self.building = "packages"
289 self.server.runCommand(["buildTargets", pkgs, "build"])
290
291 def cancel_build(self, force=False): 288 def cancel_build(self, force=False):
292 if force: 289 if force:
293 # Force the cooker to stop as quickly as possible 290 # Force the cooker to stop as quickly as possible
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index 51a995e491..0f738ce4b5 100644
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -459,6 +459,9 @@ class MainWindow (gtk.Window):
459 image_name = recipepath.rstrip(".bb") 459 image_name = recipepath.rstrip(".bb")
460 path, sep, image_name = image_name.rpartition("/") 460 path, sep, image_name = image_name.rpartition("/")
461 461
462 image = []
463 image.append(image_name)
464
462 rep.writeRecipe(recipepath, self.model) 465 rep.writeRecipe(recipepath, self.model)
463 # In the case where we saved the file for the purpose of building 466 # In the case where we saved the file for the purpose of building
464 # it we should then delete it so that the users workspace doesn't 467 # it we should then delete it so that the users workspace doesn't
@@ -466,9 +469,9 @@ class MainWindow (gtk.Window):
466 if not self.save_path: 469 if not self.save_path:
467 self.files_to_clean.append(recipepath) 470 self.files_to_clean.append(recipepath)
468 471
469 self.handler.build_image(image_name, self.configurator) 472 self.handler.build_targets(image, self.configurator)
470 else: 473 else:
471 self.handler.build_packages(self.model.get_selected_pn()) 474 self.handler.build_targets(self.model.get_selected_pn(), self.configurator, "packages")
472 475
473 # Disable parts of the menu which shouldn't be used whilst building 476 # Disable parts of the menu which shouldn't be used whilst building
474 self.set_menus_sensitive(False) 477 self.set_menus_sensitive(False)
@@ -490,7 +493,7 @@ class MainWindow (gtk.Window):
490 493
491 def build_complete_cb(self, running_build): 494 def build_complete_cb(self, running_build):
492 # Have the handler process BB events again 495 # Have the handler process BB events again
493 self.handler.building = None 496 self.handler.building = False
494 self.stopping = False 497 self.stopping = False
495 self.back.connect("clicked", self.back_button_clicked_cb) 498 self.back.connect("clicked", self.back_button_clicked_cb)
496 self.back.set_sensitive(True) 499 self.back.set_sensitive(True)
@@ -504,7 +507,7 @@ class MainWindow (gtk.Window):
504 self.files_to_clean = [] 507 self.files_to_clean = []
505 508
506 lbl = "<b>Build completed</b>\n\nClick 'Edit Image' to start another build or 'View Messages' to view the messages output during the build." 509 lbl = "<b>Build completed</b>\n\nClick 'Edit Image' to start another build or 'View Messages' to view the messages output during the build."
507 if self.handler.building == "image" and self.build_succeeded: 510 if self.handler.build_type == "image" and self.build_succeeded:
508 deploy = self.handler.get_image_deploy_dir() 511 deploy = self.handler.get_image_deploy_dir()
509 lbl = lbl + "\n<a href=\"file://%s\" title=\"%s\">Browse folder of built images</a>." % (deploy, deploy) 512 lbl = lbl + "\n<a href=\"file://%s\" title=\"%s\">Browse folder of built images</a>." % (deploy, deploy)
510 513