diff options
| author | Christopher Larson <chris_larson@mentor.com> | 2012-08-02 15:10:50 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-15 14:26:37 +0100 |
| commit | 096306ecd1bb80fe5e732584caca0172305628a2 (patch) | |
| tree | 107f7e9dbcb4eeead29e5d37f3ed4a61e35c1cc0 | |
| parent | 5ec61a7b49a9c69066e67415cddedf33eed80ea9 (diff) | |
| download | poky-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>
| -rw-r--r-- | meta/classes/base.bbclass | 12 |
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): | |||
| 34 | python oe_import_eh () { | 34 | python 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 | ||
| 40 | addhandler oe_import_eh | 40 | addhandler oe_import_eh |
| 41 | 41 | ||
| 42 | def 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 | |||
| 42 | die() { | 52 | die() { |
| 43 | bbfatal "$*" | 53 | bbfatal "$*" |
| 44 | } | 54 | } |
