diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-05 10:07:00 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-05 22:26:32 +0100 |
commit | 425435f403bce05614ab91d4f685135c30408a99 (patch) | |
tree | 94f42bac8ca32e5ff11555e79e12c9a77900947a | |
parent | 904ae4a7531d6cb8b2cfefb7da8901b21a65ae7b (diff) | |
download | openembedded-core-425435f403bce05614ab91d4f685135c30408a99.tar.gz openembedded-core-425435f403bce05614ab91d4f685135c30408a99.tar.bz2 openembedded-core-425435f403bce05614ab91d4f685135c30408a99.zip |
base.bbclass: Implement PRINC, a way to increment the PR variable in .bbappend files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r-- | meta-emenlow/packages/formfactor/formfactor_0.0.bbappend | 2 | ||||
-rw-r--r-- | meta/classes/base.bbclass | 21 |
2 files changed, 21 insertions, 2 deletions
diff --git a/meta-emenlow/packages/formfactor/formfactor_0.0.bbappend b/meta-emenlow/packages/formfactor/formfactor_0.0.bbappend index 9bc9eed5cf..4a41d4871d 100644 --- a/meta-emenlow/packages/formfactor/formfactor_0.0.bbappend +++ b/meta-emenlow/packages/formfactor/formfactor_0.0.bbappend @@ -1,3 +1,3 @@ FILESEXTRAPATHS := "${THISDIR}/${PN}" -PR = "r26" +PRINC = "1" diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index a9e5657d86..9ab8204dbc 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -440,7 +440,26 @@ do_build = "" do_build[func] = "1" python () { - import exceptions + import exceptions, string + + # If PRINC is set, try and increase the PR value by the amount specified + princ = bb.data.getVar('PRINC', d, True) + if princ: + pr = bb.data.getVar('PR', d, True) + start = -1 + end = -1 + for i in range(len(pr)): + if pr[i] in string.digits: + if start == -1: + start = i + else: + end = i + if start == -1 or end == -1: + bb.error("Unable to analyse format of PR variable: %s" % pr) + prval = pr[start:end+1] + prval = int(prval) + int(princ) + pr = pr[0:start] + str(prval) + pr[end:len(pr)-1] + bb.data.setVar('PR', pr, d) pn = bb.data.getVar('PN', d, 1) license = bb.data.getVar('LICENSE', d, True) |