[bitbake-devel] [RFC PATCH 1/1] bitbake/cooker.py: set the PREFERRED_VERSION from command line

Richard Purdie richard.purdie at linuxfoundation.org
Tue Jan 7 13:18:45 UTC 2014


On Mon, 2014-01-06 at 18:53 +0800, Robert Yang wrote:
> We can't set the PREFERRED_VERSION from the command line, this will make
> it possible:
> 
> $ P_V="3.81" bitbake make
> $ P_V="3.81" bitbake make-native
> 
> Then the make-3.81 and make-native-3.81 will be built (the default is
> 3.82)
> 
> Another we that we have originally thought was:
> 
> $ export BB_PRESERVE_ENV=1
> $ PREFERRED_VERSION_make = 3.81 bitbake make
> 
> This worked for make, but didn't work for make-native since
> we can't use "-" in a shell environment variable.
> 
> TODO:
> * This is just a RFC and open for discussion, any comments is
>   appreciated.
> 
> * It only can set the PREFERRED_VERSION for the pkg_to_build, we can
>   make it more flexible, for example, if we found the keyword
>   PREFERRED_VERSION in the P_V, we can set it for any recipe:
>   (assume core-image-sato RDEPENDS on make)
>   $ P_V="PREFERRED_VERSION_make=3.81" bitbake core-image-sato

Well, this defines a different version of PREFERRED_VERSION with
completely different semantics to the other one. I don't think this is
acceptable or a good way to avoid this problem and will ultimately just
confuse more users.

> * BTW, another questions, can we change the PREFERRED_VERSION to P_V
>   or PF_V, and the PREFERRED_PROVIDER to P_P ot PF_P, please ? They are
>   a little long to type and easy to make typos currently.

No, this would be extremely confusing with PV and other variables.
Please use copy and paste or something ;-).

A better way of handling things might be to translate "__" to "-" when
importing variables from the environment so you could set:

PREFERRED_VERSION_make__native = "3.81"

I'm open to other ideas but don't like P_V at all, particularly when it
behaves differently to PREFERRED_VERSION.

Cheers,

Richard






More information about the bitbake-devel mailing list