diff options
Diffstat (limited to 'lib/bb/ui')
-rwxr-xr-x | lib/bb/ui/crumbs/builder.py | 32 | ||||
-rw-r--r-- | lib/bb/ui/crumbs/hobeventhandler.py | 5 | ||||
-rw-r--r-- | lib/bb/ui/crumbs/template.py | 24 |
3 files changed, 24 insertions, 37 deletions
diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py index 9da926dd1..e9cfa2197 100755 --- a/lib/bb/ui/crumbs/builder.py +++ b/lib/bb/ui/crumbs/builder.py @@ -217,26 +217,32 @@ class Configuration: self.split_proxy("git", template.getVar("GIT_PROXY_HOST") + ":" + template.getVar("GIT_PROXY_PORT")) self.split_proxy("cvs", template.getVar("CVS_PROXY_HOST") + ":" + template.getVar("CVS_PROXY_PORT")) - def save(self, template, defaults=False): + def save(self, handler, template, defaults=False): template.setVar("VERSION", "%s" % hobVer) # bblayers.conf - template.setVar("BBLAYERS", " ".join(self.layers)) + handler.set_var_in_file("BBLAYERS", self.layers, "bblayers.conf") # local.conf if not defaults: - template.setVar("MACHINE", self.curr_mach) - template.setVar("DISTRO", self.curr_distro) - template.setVar("DL_DIR", self.dldir) - template.setVar("SSTATE_DIR", self.sstatedir) - template.setVar("SSTATE_MIRRORS", self.sstatemirror) - template.setVar("PARALLEL_MAKE", "-j %s" % self.pmake) - template.setVar("BB_NUMBER_THREADS", self.bbthread) - template.setVar("PACKAGE_CLASSES", " ".join(["package_" + i for i in self.curr_package_format.split()])) + handler.set_var_in_file("MACHINE", self.curr_mach, "local.conf") + handler.set_var_in_file("DISTRO", self.curr_distro, "local.conf") + handler.set_var_in_file("DL_DIR", self.dldir, "local.conf") + handler.set_var_in_file("SSTATE_DIR", self.sstatedir, "local.conf") + sstate_mirror_list = self.sstatemirror.split("\\n ") + sstate_mirror_list_modified = [] + for mirror in sstate_mirror_list: + if mirror != "": + mirror = mirror + "\\n" + sstate_mirror_list_modified.append(mirror) + handler.set_var_in_file("SSTATE_MIRRORS", sstate_mirror_list_modified, "local.conf") + handler.set_var_in_file("PARALLEL_MAKE", "-j %s" % self.pmake, "local.conf") + handler.set_var_in_file("BB_NUMBER_THREADS", self.bbthread, "local.conf") + handler.set_var_in_file("PACKAGE_CLASSES", " ".join(["package_" + i for i in self.curr_package_format.split()]), "local.conf") template.setVar("IMAGE_ROOTFS_SIZE", self.image_rootfs_size) template.setVar("IMAGE_EXTRA_SPACE", self.image_extra_size) template.setVar("INCOMPATIBLE_LICENSE", self.incompat_license) template.setVar("SDKMACHINE", self.curr_sdk_machine) - template.setVar("CONF_VERSION", self.conf_version) - template.setVar("LCONF_VERSION", self.lconf_version) + handler.set_var_in_file("CONF_VERSION", self.conf_version, "local.conf") + handler.set_var_in_file("LCONF_VERSION", self.lconf_version, "bblayers.conf") template.setVar("EXTRA_SETTING", self.extra_setting) template.setVar("TOOLCHAIN_BUILD", self.toolchain_build) template.setVar("IMAGE_FSTYPES", self.image_fstypes) @@ -670,7 +676,7 @@ class Builder(gtk.Window): self.template = TemplateMgr() try: self.template.open(filename, path) - self.configuration.save(self.template, defaults) + self.configuration.save(self.handler, self.template, defaults) self.template.save() except Exception as e: diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py index 41022ef8e..d953f3497 100644 --- a/lib/bb/ui/crumbs/hobeventhandler.py +++ b/lib/bb/ui/crumbs/hobeventhandler.py @@ -146,7 +146,9 @@ class HobHandler(gobject.GObject): elif next_command == self.SUB_MATCH_CLASS: self.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"]) elif next_command == self.SUB_PARSE_CONFIG: + self.runCommand(["enableDataTracking"]) self.runCommand(["parseConfigurationFiles", "", ""]) + self.runCommand(["disableDataTracking"]) elif next_command == self.SUB_GNERATE_TGTS: self.runCommand(["generateTargetsTree", "classes/image.bbclass", []]) elif next_command == self.SUB_GENERATE_PKGINFO: @@ -451,6 +453,9 @@ class HobHandler(gobject.GObject): ret.append(i) return " ".join(ret) + def set_var_in_file(self, var, val, default_file=None): + self.server.runCommand(["setVarFile", var, val, default_file]) + def get_parameters(self): # retrieve the parameters from bitbake params = {} diff --git a/lib/bb/ui/crumbs/template.py b/lib/bb/ui/crumbs/template.py index e303c3a6b..92c438f00 100644 --- a/lib/bb/ui/crumbs/template.py +++ b/lib/bb/ui/crumbs/template.py @@ -137,8 +137,6 @@ class RecipeFile(ConfigFile): class TemplateMgr(gobject.GObject): - __gLocalVars__ = ["MACHINE", "PACKAGE_CLASSES", "DISTRO", "DL_DIR", "SSTATE_DIR", "SSTATE_MIRRORS", "PARALLEL_MAKE", "BB_NUMBER_THREADS", "CONF_VERSION"] - __gBBLayersVars__ = ["BBLAYERS", "LCONF_VERSION"] __gRecipeVars__ = ["DEPENDS", "IMAGE_INSTALL"] def __init__(self): @@ -153,36 +151,20 @@ class TemplateMgr(gobject.GObject): return "%s/%s%s%s" % (path, "template-", filename, ".hob") @classmethod - def convert_to_bblayers_pathfilename(cls, filename, path): - return "%s/%s%s%s" % (path, "bblayers-", filename, ".conf") - - @classmethod - def convert_to_local_pathfilename(cls, filename, path): - return "%s/%s%s%s" % (path, "local-", filename, ".conf") - - @classmethod def convert_to_image_pathfilename(cls, filename, path): return "%s/%s%s%s" % (path, "hob-image-", filename, ".bb") def open(self, filename, path): self.template_hob = HobTemplateFile(TemplateMgr.convert_to_template_pathfilename(filename, path)) - self.bblayers_conf = ConfigFile(TemplateMgr.convert_to_bblayers_pathfilename(filename, path)) - self.local_conf = ConfigFile(TemplateMgr.convert_to_local_pathfilename(filename, path)) self.image_bb = RecipeFile(TemplateMgr.convert_to_image_pathfilename(filename, path)) def setVar(self, var, val): - if var in TemplateMgr.__gLocalVars__: - self.local_conf.setVar(var, val) - if var in TemplateMgr.__gBBLayersVars__: - self.bblayers_conf.setVar(var, val) if var in TemplateMgr.__gRecipeVars__: self.image_bb.setVar(var, val) self.template_hob.setVar(var, val) def save(self): - self.local_conf.save() - self.bblayers_conf.save() self.image_bb.save() self.template_hob.save() @@ -200,12 +182,6 @@ class TemplateMgr(gobject.GObject): if self.template_hob: del self.template_hob template_hob = None - if self.bblayers_conf: - del self.bblayers_conf - self.bblayers_conf = None - if self.local_conf: - del self.local_conf - self.local_conf = None if self.image_bb: del self.image_bb self.image_bb = None |