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, 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


-- 
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Reply via email to