* [RFC PATCH 0/1] set the PREFERRED_VERSION from command line @ 2014-01-06 10:53 Robert Yang 2014-01-06 10:53 ` [RFC PATCH 1/1] bitbake/cooker.py: " Robert Yang 0 siblings, 1 reply; 3+ messages in thread From: Robert Yang @ 2014-01-06 10:53 UTC (permalink / raw) To: bitbake-devel The following changes since commit 2f792445bfc671081152f06e1cd507c049eb21ee: logrotate: two minor fixes (2014-01-06 18:25:45 +0800) are available in the git repository at: git://git.pokylinux.org/poky-contrib robert/PV http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/PV Robert Yang (1): bitbake/cooker.py: set the PREFERRED_VERSION from command line bitbake/lib/bb/cooker.py | 5 +++++ bitbake/lib/bb/cookerdata.py | 1 + scripts/oe-buildenv-internal | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) -- 1.8.3.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [RFC PATCH 1/1] bitbake/cooker.py: set the PREFERRED_VERSION from command line 2014-01-06 10:53 [RFC PATCH 0/1] set the PREFERRED_VERSION from command line Robert Yang @ 2014-01-06 10:53 ` Robert Yang 2014-01-07 13:18 ` Richard Purdie 0 siblings, 1 reply; 3+ messages in thread From: Robert Yang @ 2014-01-06 10:53 UTC (permalink / raw) To: bitbake-devel 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 * 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. [YOCTO #4965] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> --- bitbake/lib/bb/cooker.py | 5 +++++ bitbake/lib/bb/cookerdata.py | 1 + scripts/oe-buildenv-internal | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index db4cb51..a6c30b8 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -180,6 +180,11 @@ class BBCooker: self.data = self.databuilder.data self.data_hash = self.databuilder.data_hash + P_V = self.data.getVar('P_V') + if P_V and len(self.configuration.pkgs_to_build) == 1: + pkg = ''.join(self.configuration.pkgs_to_build) + logger.info("Setting PREFERRED_VERSION_%s to %s" % (pkg, P_V)) + self.data.setVar("PREFERRED_VERSION_%s" % pkg, P_V) # # Special updated configuration we use for firing events # diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index 6200b0e..faf71da 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py @@ -128,6 +128,7 @@ class CookerConfiguration(object): self.dry_run = False self.tracking = False self.interface = [] + self.pkgs_to_build = [] self.env = {} diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal index bba6f8f..5c17a9a 100755 --- a/scripts/oe-buildenv-internal +++ b/scripts/oe-buildenv-internal @@ -106,4 +106,4 @@ export BB_ENV_EXTRAWHITE="MACHINE DISTRO TCMODE TCLIBC HTTP_PROXY http_proxy \ HTTPS_PROXY https_proxy FTP_PROXY ftp_proxy FTPS_PROXY ftps_proxy ALL_PROXY \ all_proxy NO_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY \ SDKMACHINE BB_NUMBER_THREADS BB_NO_NETWORK PARALLEL_MAKE GIT_PROXY_COMMAND \ -SOCKS5_PASSWD SOCKS5_USER SCREENDIR STAMPS_DIR" +SOCKS5_PASSWD SOCKS5_USER SCREENDIR STAMPS_DIR P_V" -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH 1/1] bitbake/cooker.py: set the PREFERRED_VERSION from command line 2014-01-06 10:53 ` [RFC PATCH 1/1] bitbake/cooker.py: " Robert Yang @ 2014-01-07 13:18 ` Richard Purdie 0 siblings, 0 replies; 3+ messages in thread From: Richard Purdie @ 2014-01-07 13:18 UTC (permalink / raw) To: Robert Yang; +Cc: bitbake-devel 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-07 13:19 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-01-06 10:53 [RFC PATCH 0/1] set the PREFERRED_VERSION from command line Robert Yang 2014-01-06 10:53 ` [RFC PATCH 1/1] bitbake/cooker.py: " Robert Yang 2014-01-07 13:18 ` Richard Purdie
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.