Patchwork [PATCHv2] bitbake.conf: add default PRINC 0 to be able to increment it

login
register
mail settings
Submitter Martin Jansa
Date Dec. 2, 2011, 6:39 p.m.
Message ID <1322851144-6988-1-git-send-email-Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/16117/
State Accepted
Commit 656793c706d84460f397b10ceb23ebb721ed3960
Headers show

Comments

Martin Jansa - Dec. 2, 2011, 6:39 p.m.
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/base.bbclass |    2 +-
 meta/conf/bitbake.conf    |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)
Chris Larson - Dec. 2, 2011, 7:29 p.m.
On Fri, Dec 2, 2011 at 11:39 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta/classes/base.bbclass |    2 +-
>  meta/conf/bitbake.conf    |    1 +
>  2 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index ea53498..fbcaefb 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -335,7 +335,7 @@ python () {
>
>     # If PRINC is set, try and increase the PR value by the amount specified
>     princ = d.getVar('PRINC', True)
> -    if princ:
> +    if princ and princ != "0":

Could also do:

  if int(princ):

Or:

  PRINC[type] = "integer" # and:

  if oe.data.typed_value('PRINC', d):
Richard Purdie - Dec. 5, 2011, 4:09 p.m.
On Fri, 2011-12-02 at 19:39 +0100, Martin Jansa wrote:
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta/classes/base.bbclass |    2 +-
>  meta/conf/bitbake.conf    |    1 +
>  2 files changed, 2 insertions(+), 1 deletions(-)

Merged to master, thanks.

Richard

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index ea53498..fbcaefb 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -335,7 +335,7 @@  python () {
 
     # If PRINC is set, try and increase the PR value by the amount specified
     princ = d.getVar('PRINC', True)
-    if princ:
+    if princ and princ != "0":
         pr = d.getVar('PR', True)
         pr_prefix = re.search("\D+",pr)
         prval = re.search("\d+",pr)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index acba388..e80cc32 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -167,6 +167,7 @@  ASSUME_PROVIDED = "\
 PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[0] or 'defaultpkgname'}"
 PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[1] or '1.0'}"
 PR = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[2] or 'r0'}"
+PRINC ?= "0"
 PF = "${PN}-${EXTENDPE}${PV}-${PR}"
 EXTENDPE = "${@['','${PE\x7d_'][d.getVar('PE',1) > 0]}"
 P = "${PN}-${PV}"