diff options
Diffstat (limited to 'bitbake/lib/bb/ui/hob.py')
-rw-r--r-- | bitbake/lib/bb/ui/hob.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py index 865933c95a..d3442c518c 100644 --- a/bitbake/lib/bb/ui/hob.py +++ b/bitbake/lib/bb/ui/hob.py | |||
@@ -369,20 +369,31 @@ class MainWindow (gtk.Window): | |||
369 | self.dirty = False | 369 | self.dirty = False |
370 | 370 | ||
371 | def bake_clicked_cb(self, button): | 371 | def bake_clicked_cb(self, button): |
372 | build_image = True | ||
373 | |||
372 | rep = self.model.get_build_rep() | 374 | rep = self.model.get_build_rep() |
373 | if not rep.base_image: | 375 | if not rep.base_image: |
374 | lbl = "<b>Build only packages?</b>\n\nAn image has not been selected, so only the selected packages will be built." | 376 | lbl = "<b>Build empty image or only packages?</b>\nA base image" |
377 | lbl = lbl + " has not been selected.\n\'Empty image' will build" | ||
378 | lbl = lbl + " an image with only the selected packages as its" | ||
379 | lbl = lbl + " contents.\n'Packages Only' will build only the" | ||
380 | lbl = lbl + " selected packages, no image will be created" | ||
375 | dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING) | 381 | dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING) |
376 | dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) | 382 | dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) |
377 | dialog.add_button("Build", gtk.RESPONSE_YES) | 383 | dialog.add_button("Empty Image", gtk.RESPONSE_OK) |
384 | dialog.add_button("Packages Only", gtk.RESPONSE_YES) | ||
378 | response = dialog.run() | 385 | response = dialog.run() |
379 | dialog.destroy() | 386 | dialog.destroy() |
380 | if response == gtk.RESPONSE_CANCEL: | 387 | if response == gtk.RESPONSE_CANCEL: |
381 | return | 388 | return |
382 | else: | 389 | elif response == gtk.RESPONSE_YES: |
383 | self.handler.build_packages(rep.allpkgs.split(" ")) | 390 | build_image = False |
384 | else: | 391 | elif response == gtk.RESPONSE_OK: |
392 | rep.base_image = "empty" | ||
393 | |||
394 | if build_image: | ||
385 | import tempfile, datetime | 395 | import tempfile, datetime |
396 | |||
386 | image_name = "hob-%s-variant-%s" % (rep.base_image, datetime.date.today().isoformat()) | 397 | image_name = "hob-%s-variant-%s" % (rep.base_image, datetime.date.today().isoformat()) |
387 | image_file = "%s.bb" % (image_name) | 398 | image_file = "%s.bb" % (image_name) |
388 | image_dir = os.path.join(tempfile.gettempdir(), 'hob-images') | 399 | image_dir = os.path.join(tempfile.gettempdir(), 'hob-images') |
@@ -397,6 +408,8 @@ class MainWindow (gtk.Window): | |||
397 | self.files_to_clean.append(recipepath) | 408 | self.files_to_clean.append(recipepath) |
398 | 409 | ||
399 | self.handler.build_image(image_name, image_dir, self.configurator) | 410 | self.handler.build_image(image_name, image_dir, self.configurator) |
411 | else: | ||
412 | self.handler.build_packages(rep.allpkgs.split(" ")) | ||
400 | 413 | ||
401 | self.nb.set_current_page(1) | 414 | self.nb.set_current_page(1) |
402 | 415 | ||