[Toaster] general solution proposed for 7394 "Toaster needs to add a space to the value of IMAGE_INSTALL_append"
Damian, Alexandru
alexandru.damian at intel.com
Thu Mar 12 07:09:34 PDT 2015
I think this needs input from Paul and Richard on how to treat troublesome
variables.
Paul, RP: short problem statement: some variables need to have " " (i.e.
space char) surrounding the value to prevent wrong token checkout on _append
I.e. we want "a b" appended to "0 1" end up with "0 1 a b" instead of "0
1a b".
The question is - how to treat this in a generic manner throughout the
interface ?
David has some options below.
Cheers,
Alex
On Thu, Mar 12, 2015 at 6:09 AM, Reyna, David <david.reyna at windriver.com>
wrote:
> Hi Alex, Belén, and all,
>
> I am looking at 7394, and while I can hard code something for
> “IMAGE_INSTALL_append”, it will instantly break once anyone tries to
> introduce any other variable that need special handling.
>
> I would like instead to propose a general but simple solution to cover all
> the usual cases, with no hard-coding, and about the same amount of code
> complexity that the limited solution would require.
>
> 1) Here is my source information about ways variables can be manipulated
> *http://elinux.org/Bitbake_Cheat_Sheet*
> <http://elinux.org/Bitbake_Cheat_Sheet>, for example:
>
> VAR = "foo" simple assignment
> VAR ?= "foo" assign if no other value is already assigned (default
> assignment)
> VAR += "foo" append with space
> VAR =+ "foo" prepend with space
> VAR .= "foo" append without space
> VAR =. "foo" prepend without space
> VAR_append = "foo" append without space
>
> You will observe that currently we (a) really only cover simple
> assignments, and (b) the trick with the IMAGE_INSTALL having “_append” is
> in fact misleading, since it does not line up with the bitbake syntax which
> would indicate that _*no*_ space would be added – so wrong for
> IMAGE_INSTALL.
>
> 2) Here is my proposed solution
>
> (a) Allow variables to have the following suffixes that align with the
> common bitbake operators:
>
> *VAR* *| **simple assignment *
> *VAR?=* *| **assign if no other value is already assigned*
> *VAR+= * *| **append with space *
> *VAR=+* *| **prepend with space *
> *VAR.=* *| **append without space *
> *VAR=.* *| **prepend without space *
> *VAR_append* *| **append without space*
>
> (b) In “writeConfFile()” in the file
> “bitbake/lib/toaster/bldcontrol/localhostbecontroller.py”, change the code
> to swap in the respective operator in place of “=”.
>
> (c) In the configure variable page change the javascript variable name
> validation code to allow these specific suffixes (plus the error messages).
>
> In fact what we can do is have a pull down list in the page to specific
> and select any of the supported special operators, and let the javascript
> manipulate these special syntaxes. That way no one needs to memorize/learn
> about the supported operators, making the whole thing more intuitive and
> self-directed.
>
> (d) Change the core variable “IMAGE_INSTALL_append” to
> “IMAGE_INSTALL+=” to take advantage of this new facility and resolve the
> original defect (this name change would be in the JSON file and in the view
> class).
>
> (e) Finally, send the documentation on this to Scott.
>
> Is this acceptable? It would be easy to implement, and I think a lot more
> scalable, useful, and correct.
>
> - David
>
>
>
--
Alex Damian
Yocto Project
SSG / OTC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/toaster/attachments/20150312/dd90a753/attachment.html>
More information about the toaster
mailing list