summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-10-05 10:07:00 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-10-05 22:26:32 +0100
commit425435f403bce05614ab91d4f685135c30408a99 (patch)
tree94f42bac8ca32e5ff11555e79e12c9a77900947a /meta/classes/base.bbclass
parent904ae4a7531d6cb8b2cfefb7da8901b21a65ae7b (diff)
downloadpoky-425435f403bce05614ab91d4f685135c30408a99.tar.gz
base.bbclass: Implement PRINC, a way to increment the PR variable in .bbappend files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass21
1 files changed, 20 insertions, 1 deletions
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 = ""
440do_build[func] = "1" 440do_build[func] = "1"
441 441
442python () { 442python () {
443 import exceptions 443 import exceptions, string
444
445 # If PRINC is set, try and increase the PR value by the amount specified
446 princ = bb.data.getVar('PRINC', d, True)
447 if princ:
448 pr = bb.data.getVar('PR', d, True)
449 start = -1
450 end = -1
451 for i in range(len(pr)):
452 if pr[i] in string.digits:
453 if start == -1:
454 start = i
455 else:
456 end = i
457 if start == -1 or end == -1:
458 bb.error("Unable to analyse format of PR variable: %s" % pr)
459 prval = pr[start:end+1]
460 prval = int(prval) + int(princ)
461 pr = pr[0:start] + str(prval) + pr[end:len(pr)-1]
462 bb.data.setVar('PR', pr, d)
444 463
445 pn = bb.data.getVar('PN', d, 1) 464 pn = bb.data.getVar('PN', d, 1)
446 license = bb.data.getVar('LICENSE', d, True) 465 license = bb.data.getVar('LICENSE', d, True)