summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@intel.com>2012-12-12 22:56:41 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-13 16:54:35 +0000
commit0be41d6e30e6dfd9d77e7b8b7ca11ab0b8474cbb (patch)
tree774a6d13608e916e349aa720b91c9c24531b71f9
parent76b2ef26e7ee23cbf05051c3978a37f0ee4062b9 (diff)
downloadast2050-yocto-poky-0be41d6e30e6dfd9d77e7b8b7ca11ab0b8474cbb.zip
ast2050-yocto-poky-0be41d6e30e6dfd9d77e7b8b7ca11ab0b8474cbb.tar.gz
yocto-kernel: add support for PRs of the form rN to pr_inc()
With the addition of custom kernel support, we also need to handle the normal PR format found in .bb files. (From meta-yocto rev: e17570b6bbd36a731f546f800ef5f271ed5c3697) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/bsp/kernel.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index 883beac..5935e66 100644
--- a/scripts/lib/bsp/kernel.py
+++ b/scripts/lib/bsp/kernel.py
@@ -427,16 +427,20 @@ def yocto_kernel_patch_add(scripts_path, machine, patches):
def inc_pr(line):
"""
Add 1 to the PR value in the given bbappend PR line. For the PR
- lines in kernel .bbappends after modifications.
+ lines in kernel .bbappends after modifications. Handles PRs of
+ the form PR := "${PR}.1" as well as PR = "r0".
"""
idx = line.find("\"")
pr_str = line[idx:]
pr_str = pr_str.replace('\"','')
fields = pr_str.split('.')
- fields[1] = str(int(fields[1]) + 1)
- pr_str = "\"" + '.'.join(fields) + "\"\n"
-
+ if len(fields) > 1:
+ fields[1] = str(int(fields[1]) + 1)
+ pr_str = "\"" + '.'.join(fields) + "\"\n"
+ else:
+ pr_val = pr_str[1:]
+ pr_str = "\"" + "r" + str(int(pr_val) + 1) + "\"\n"
idx2 = line.find("\"", idx + 1)
line = line[:idx] + pr_str
OpenPOWER on IntegriCloud