diff options
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/builder.py')
| -rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builder.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 899d0e0c16..bcce41dbb6 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py | |||
| @@ -40,6 +40,8 @@ from bb.ui.crumbs.hig import CrumbsMessageDialog, ImageSelectionDialog, \ | |||
| 40 | from bb.ui.crumbs.persistenttooltip import PersistentTooltip | 40 | from bb.ui.crumbs.persistenttooltip import PersistentTooltip |
| 41 | import bb.ui.crumbs.utils | 41 | import bb.ui.crumbs.utils |
| 42 | 42 | ||
| 43 | hobVer = 20120530 | ||
| 44 | |||
| 43 | class Configuration: | 45 | class Configuration: |
| 44 | '''Represents the data structure of configuration.''' | 46 | '''Represents the data structure of configuration.''' |
| 45 | 47 | ||
| @@ -222,6 +224,7 @@ class Configuration: | |||
| 222 | self.split_proxy("cvs", template.getVar("CVS_PROXY_HOST") + ":" + template.getVar("CVS_PROXY_PORT")) | 224 | self.split_proxy("cvs", template.getVar("CVS_PROXY_HOST") + ":" + template.getVar("CVS_PROXY_PORT")) |
| 223 | 225 | ||
| 224 | def save(self, template, defaults=False): | 226 | def save(self, template, defaults=False): |
| 227 | template.setVar("VERSION", "%s" % hobVer) | ||
| 225 | # bblayers.conf | 228 | # bblayers.conf |
| 226 | template.setVar("BBLAYERS", " ".join(self.layers)) | 229 | template.setVar("BBLAYERS", " ".join(self.layers)) |
| 227 | # local.conf | 230 | # local.conf |
| @@ -468,7 +471,7 @@ class Builder(gtk.Window): | |||
| 468 | 471 | ||
| 469 | def initiate_new_build_async(self): | 472 | def initiate_new_build_async(self): |
| 470 | self.switch_page(self.MACHINE_SELECTION) | 473 | self.switch_page(self.MACHINE_SELECTION) |
| 471 | if self.load_template(TemplateMgr.convert_to_template_pathfilename("default", ".hob/")) == None: | 474 | if self.load_template(TemplateMgr.convert_to_template_pathfilename("default", ".hob/")) == False: |
| 472 | self.handler.init_cooker() | 475 | self.handler.init_cooker() |
| 473 | self.handler.set_extra_inherit("image_types") | 476 | self.handler.set_extra_inherit("image_types") |
| 474 | self.handler.generate_configuration() | 477 | self.handler.generate_configuration() |
| @@ -537,9 +540,16 @@ class Builder(gtk.Window): | |||
| 537 | 540 | ||
| 538 | def load_template(self, path): | 541 | def load_template(self, path): |
| 539 | if not os.path.isfile(path): | 542 | if not os.path.isfile(path): |
| 540 | return None | 543 | return False |
| 541 | 544 | ||
| 542 | self.template = TemplateMgr() | 545 | self.template = TemplateMgr() |
| 546 | # check compatibility | ||
| 547 | tempVer = self.template.getVersion(path) | ||
| 548 | if not tempVer or int(tempVer) < hobVer: | ||
| 549 | self.template.destroy() | ||
| 550 | self.template = None | ||
| 551 | return False | ||
| 552 | |||
| 543 | try: | 553 | try: |
| 544 | self.template.load(path) | 554 | self.template.load(path) |
| 545 | self.configuration.load(self.template) | 555 | self.configuration.load(self.template) |
