From patchwork Tue Aug 14 12:13:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [CONSOLIDATED, REQUEST, 40/64] base.bbclass: allow specifying an lsb distro hook via the metadata Date: Tue, 14 Aug 2012 12:13:27 -0000 From: Saul Wold X-Patchwork-Id: 34585 Message-Id: <1b3e82cb22f5c9d0bbe562327f8c90c26ca12b1c.1344946189.git.sgw@linux.intel.com> To: openembedded-core@lists.openembedded.org Cc: Christopher Larson From: Christopher Larson 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 Signed-off-by: Saul Wold --- 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 3e6a7de..8845d81 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -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 "$*" }