[bitbake-devel] [PATCH 3/7] Hob: Make layers define in bblayers.conf as default
Richard Purdie
richard.purdie at linuxfoundation.org
Mon Apr 2 12:42:01 UTC 2012
On Sun, 2012-04-01 at 13:35 +0800, Xu, Dongxiao wrote:
> On Sat, 2012-03-31 at 16:51 +0100, Richard Purdie wrote:
> > I'd be happy if you change the above code to do:
> >
> > self.server.runCommand(["deleteVariable", "DISTRO"])
> >
> > which is subtly different but consistent with what we really want. I
> > have no idea if we have a deleteVariable command but if we don't, we
> > should add one.
>
> I ever tried this approach with the following patch, however it didn't
> work. The setting of DISTRO ?= "poky" will still take effect.
>
> It seems that delVar(DISTRO) is different from setting DISTRO="".
It is different but it is what setting up OE-Core without DISTRO set
does and that is known to work.
We need to understand why this isn't working as it should...
Cheers,
Richard
>
> diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
> index 73aaca0..a7b41ce 100644
> --- a/bitbake/lib/bb/command.py
> +++ b/bitbake/lib/bb/command.py
> @@ -160,6 +160,13 @@ class CommandsSync:
> value = params[1]
> command.cooker.configuration.data.setVar(varname, value)
>
> + def delVariable(self, command, params):
> + """
> + Delete the variable in configuration.data
> + """
> + varname = params[0]
> + command.cooker.configuration.data.delVar(varname)
> +
> def initCooker(self, command, params):
> """
> Init the cooker to initial state with nothing parsed
> diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
> b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
> index 8909e01..d236a72 100644
> --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
> +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
> @@ -265,7 +265,9 @@ class HobHandler(gobject.GObject):
> self.server.runCommand(["setVariable", "IMAGE_FSTYPES",
> image_fstypes])
>
> def set_distro(self, distro):
> - if distro != "defaultsetup":
> + if distro == "defaultsetup":
> + self.server.runCommand(["delVariable", "DISTRO"])
> + else:
> self.server.runCommand(["setVariable", "DISTRO", distro])
>
> def set_package_format(self, format):
More information about the bitbake-devel
mailing list