an example of such a variable that we might want to set is PREFERRED_PROVIDER_virtual/java2-runtime to openjdk-7-jre. Our javascript checker says: 'A valid variable name can only include letters, numbers, underscores, and dashes'
+ is allowed and used in recipe names, so it needs to be allowed in variable names here too (since it can therefore appear in a valid _pn- override).
so, it's / and + so far. Any other special character we ought to allow?
What about not restricting the inputs? If they put in an unparseable variable, the error message should be clear, I would think.
(In reply to comment #3) > What about not restricting the inputs? If they put in an unparseable > variable, the error message should be clear, I would think. mmm, personally I don't like the approach. The CLI already let's you shoot yourself in the foot: we don't need the GUI to do that too. Most special characters are probably not allowed in OE variables (or so I was told when I designed that page). If that's the case, let's validate user input, as good web forms should. Turns out there is an answer to this in BitBake http://git.openembedded.org/bitbake/tree/lib/bb/parse/parse_py/ConfHandler.py#n33 According to RP, (?P<var>[a-zA-Z0-9\-~_+.${}/]+?) is the key bit. It implies a-zA-Z0-9\-~_+.${}/ are all acceptable So here is our answer: those are the special characters the validation should allow.
Agreed. Your's is better.
Patch submitted to the mailing list https://lists.yoctoproject.org/pipermail/toaster/2016-September/005164.html
Merged in bitbake 146f6f95a8753308edb31e952d7c440c8de11870.