Patchwork [2/5] conf/bitbake.conf: Added variables for PR service.

login
register
mail settings
Submitter Lianhao Lu
Date May 19, 2011, 10:29 a.m.
Message ID <439b9cfa6032b7c51b326a7cf888d83fd55d1305.1305800693.git.lianhao.lu@intel.com>
Download mbox | patch
Permalink /patch/4499/
State New, archived
Headers show

Comments

Lianhao Lu - May 19, 2011, 10:29 a.m.
From: Lianhao Lu <lianhao.lu@intel.com>

1. change BB_SIGNATURE_HANDLER from basic to basichash.

2. Added following variables for PR service:
USE_PR_SERV: flag of whether to use the network PR service
PRFORMAT: format of revision to be used in tasks package_write_xxx.
PRAUTOINX: search index for the network PR service

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/conf/bitbake.conf |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
Richard Purdie - May 19, 2011, 11:51 a.m.
On Thu, 2011-05-19 at 18:29 +0800, Lianhao Lu wrote:
> From: Lianhao Lu <lianhao.lu@intel.com>
> 
> 1. change BB_SIGNATURE_HANDLER from basic to basichash.
> 
> 2. Added following variables for PR service:
> USE_PR_SERV: flag of whether to use the network PR service
> PRFORMAT: format of revision to be used in tasks package_write_xxx.
> PRAUTOINX: search index for the network PR service
> 
> Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
> ---
>  meta/conf/bitbake.conf |   14 ++++++++++++--
>  1 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index a0af672..381f301 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -153,8 +153,13 @@ PR = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[2] or 'r0
>  PF = "${PN}-${EXTENDPE}${PV}-${PR}"
>  EXTENDPE = "${@['','${PE\x7d_'][bb.data.getVar('PE',d,1) > 0]}"
>  EXTENDPEVER = "${@['','${PE\x7d:'][bb.data.getVar('PE',d,1) > 0]}"
> -EXTENDPV = "${EXTENDPEVER}${PV}-${PR}"
> +EXTENDPV = "${EXTENDPEVER}${PV}-${PRFORMAT}"
>  P = "${PN}-${PV}"
> +EXTENDPREXTRA = "${@['.${PREXTRA\x7d',''][bb.data.getVar('PREXTRA',d,1) is None]}"
> +EXTENDPRAUTO = "${@['.${PRAUTO\x7d',''][bb.data.getVar('PRAUTO',d,1) is None]}"
> +PRAUTOINX = "${PF}${EXTENDPREXTRA}"
> +PRFORMAT = "${PR}${EXTENDPREXTRA}${EXTENDPRAUTO}"
> +

There is also one thing we need to sync up with regarding openembedded
and these patches which is the use of PKGV and PKGR in package.bbclass.
Those patches are not merged into OE-Core yet but are have a similar
intention of allowing customisation to the PV and PR fields. I would
like to see if we can use PKGR for the use case we have here as well.

See:
http://git.openembedded.net/cgit.cgi/openembedded/tree/classes/package.bbclass

(I was only reminded of this recently in an IRC conversation with
Otavio)


Minor nitpick but new code should replace:

bb.data.getVar('PRAUTO',d,1)

with

d.getVar('PRAUTO', True)

which is functionally equivalent, neater and more pythonic. Its not a
major issue but worth highlighting.

Cheers,

Richard

Patch

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index a0af672..381f301 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -153,8 +153,13 @@  PR = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[2] or 'r0
 PF = "${PN}-${EXTENDPE}${PV}-${PR}"
 EXTENDPE = "${@['','${PE\x7d_'][bb.data.getVar('PE',d,1) > 0]}"
 EXTENDPEVER = "${@['','${PE\x7d:'][bb.data.getVar('PE',d,1) > 0]}"
-EXTENDPV = "${EXTENDPEVER}${PV}-${PR}"
+EXTENDPV = "${EXTENDPEVER}${PV}-${PRFORMAT}"
 P = "${PN}-${PV}"
+EXTENDPREXTRA = "${@['.${PREXTRA\x7d',''][bb.data.getVar('PREXTRA',d,1) is None]}"
+EXTENDPRAUTO = "${@['.${PRAUTO\x7d',''][bb.data.getVar('PRAUTO',d,1) is None]}"
+PRAUTOINX = "${PF}${EXTENDPREXTRA}"
+PRFORMAT = "${PR}${EXTENDPREXTRA}${EXTENDPRAUTO}"
+
 
 # Base package name
 # Automatically derives "foo" from "foo-native", "foo-cross" or "foo-initial"
@@ -163,6 +168,11 @@  SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -nativesdk -crosssdk
 BPN = "${@base_prune_suffix(bb.data.getVar('PN', d, True), bb.data.getVar('SPECIAL_PKGSUFFIX', d, True).split(), d)}"
 BP = "${BPN}-${PV}"
 
+#
+# network based PR service
+#
+USE_PR_SERV = "${@[1,0][(bb.data.getVar('PRSERV_HOST',d,1) is None) or (bb.data.getVar('PRSERV_PORT',d,1) is None)]}"
+
 # Package info.
 
 SECTION = "base"
@@ -707,7 +717,7 @@  DISTRO[unexport] = "1"
 TRANSLATED_TARGET_ARCH ??= ${TARGET_ARCH}
 
 # Setup our default hash policy
-BB_SIGNATURE_HANDLER ?= "basic"
+BB_SIGNATURE_HANDLER ?= "basichash"
 BB_HASHTASK_WHITELIST ?= "(.*-cross$|.*-native$|.*-cross-initial$|.*-cross-intermediate$|^virtual:native:.*|^virtual:nativesdk:.*)"
 BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM USER FILESPATH USERNAME STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE"