summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2012-08-02 15:10:50 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-15 14:26:37 +0100
commit096306ecd1bb80fe5e732584caca0172305628a2 (patch)
tree107f7e9dbcb4eeead29e5d37f3ed4a61e35c1cc0 /meta/classes/base.bbclass
parent5ec61a7b49a9c69066e67415cddedf33eed80ea9 (diff)
downloadpoky-096306ecd1bb80fe5e732584caca0172305628a2.tar.gz
base.bbclass: allow specifying an lsb distro hook via the metadata
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. (From OE-Core rev: 0e9932b2dba8573736c92bd07e59bad21b9fda2d) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass12
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index e15fa26ff6..192c77761e 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -34,11 +34,21 @@ def oe_import(d):
34python oe_import_eh () { 34python oe_import_eh () {
35 if isinstance(e, bb.event.ConfigParsed): 35 if isinstance(e, bb.event.ConfigParsed):
36 oe_import(e.data) 36 oe_import(e.data)
37 e.data.setVar("NATIVELSBSTRING", oe.lsb.distro_identifier()) 37 e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
38} 38}
39 39
40addhandler oe_import_eh 40addhandler oe_import_eh
41 41
42def lsb_distro_identifier(d):
43 adjust = d.getVar('LSB_DISTRO_ADJUST', True)
44 adjust_func = None
45 if adjust:
46 try:
47 adjust_func = globals()[adjust]
48 except KeyError:
49 pass
50 return oe.lsb.distro_identifier(adjust_func)
51
42die() { 52die() {
43 bbfatal "$*" 53 bbfatal "$*"
44} 54}