Patchwork kernel/module-base: Append PR to MACHINE_KERNEL_PR

login
register
mail settings
Submitter Andreas Oberritter
Date March 24, 2011, 3:37 p.m.
Message ID <1300981024-9111-2-git-send-email-obi@opendreambox.org>
Download mbox | patch
Permalink /patch/1785/
State Superseded
Headers show

Comments

Andreas Oberritter - March 24, 2011, 3:37 p.m.
Based on http://comments.gmane.org/gmane.comp.handhelds.openembedded/42905

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
CC: Denis Dydychkin <nyrl@mail.ru>
CC: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
---
 classes/kernel.bbclass      |   10 +++++++++-
 classes/module-base.bbclass |   10 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

Patch

diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index 0109ce6..a462ab4 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -24,7 +24,15 @@  python __anonymous () {
     machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
 
     if machine_kernel_pr:
-       bb.data.setVar('PR', machine_kernel_pr, d)
+       # Append
+       # a) .X, if the recipe's PR is rX, or
+       # b) +${PR}, if the recipe's PR doesn't begin with r
+       pr = bb.data.getVar('PR', d, True)
+       if pr.startswith('r'):
+               suffix = '.' + pr[1:]
+       else:
+               suffix = '+' + pr
+       bb.data.setVar('PR', machine_kernel_pr + suffix, d)
 }
 
 INITRAMFS_IMAGE ?= ""
diff --git a/classes/module-base.bbclass b/classes/module-base.bbclass
index 9aaaa4e..edc0774 100644
--- a/classes/module-base.bbclass
+++ b/classes/module-base.bbclass
@@ -11,7 +11,15 @@  python __anonymous () {
     machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
 
     if machine_kernel_pr:
-       bb.data.setVar('PR', machine_kernel_pr, d)
+       # Append
+       # a) .X, if the recipe's PR is rX, or
+       # b) +${PR}, if the recipe's PR doesn't begin with r
+       pr = bb.data.getVar('PR', d, True)
+       if pr.startswith('r'):
+               suffix = '.' + pr[1:]
+       else:
+               suffix = '+' + pr
+       bb.data.setVar('PR', machine_kernel_pr + suffix, d)
 }
 
 export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}"