]> code.ossystems Code Review - openembedded-core.git/commitdiff
base.bbclass: allow specifying an lsb distro hook via the metadata
authorChristopher Larson <chris_larson@mentor.com>
Thu, 2 Aug 2012 22:10:50 +0000 (15:10 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 15 Aug 2012 13:25:49 +0000 (14:25 +0100)
This is useful when you have a rather large set of compatible distros. For
example: Centos 5.4, 5.5, 5.6, etc, RHEL server 5.x, RHEL workstation 5.x.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/base.bbclass

index e15fa26ff6a118a646392a7b1c1a44ba92648b43..192c77761eb60202824291d3fe58911f2c158e81 100644 (file)
@@ -34,11 +34,21 @@ def oe_import(d):
 python oe_import_eh () {
     if isinstance(e, bb.event.ConfigParsed):
         oe_import(e.data)
-        e.data.setVar("NATIVELSBSTRING", oe.lsb.distro_identifier())
+        e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
 }
 
 addhandler oe_import_eh
 
+def lsb_distro_identifier(d):
+    adjust = d.getVar('LSB_DISTRO_ADJUST', True)
+    adjust_func = None
+    if adjust:
+        try:
+            adjust_func = globals()[adjust]
+        except KeyError:
+            pass
+    return oe.lsb.distro_identifier(adjust_func)
+
 die() {
        bbfatal "$*"
 }