From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6522397978051739648 X-Received: by 10.25.31.66 with SMTP id f63mr106235lff.42.1518679700699; Wed, 14 Feb 2018 23:28:20 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.25.151 with SMTP id 23ls674987ljz.5.gmail; Wed, 14 Feb 2018 23:28:20 -0800 (PST) X-Google-Smtp-Source: AH8x225RUZeWXqR3lsztAq7BnCb8ZEymeHpfp9tVakwxB35kCceXzehJxr2hMF+htCdLL7g4PU5N X-Received: by 10.46.71.206 with SMTP id u197mr80787lja.16.1518679700021; Wed, 14 Feb 2018 23:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518679699; cv=none; d=google.com; s=arc-20160816; b=EuRjtQkOiHJYzztO4gZnN+0avGysJ+REhvPEVKw42y/U54r1FKt+L7PmxsNds6Y6RT MXkUCypqUOz+/xgMkxB1mRN4PAztIbE1+OoE0qhhgTEHZH9w0d86ubu/aEpMesTJGUos 7smBo/pPHpWLaJ6/fHxQ7hiLEcHiYcGCtLWu3xNUCYbk33w32RDCnkt0h6oHX8wLWl64 IVWJPTKhxPHvc+pdn1PYBR1LQ11U+8lqYwbHnZEZ+NCvxCtslOqp+RhOaVDpbOpmmPGm kCi7MLaiEj0g0FdScXHGlEzTkmBhC0e9QqgkwtcTdJKO1TqjoWJOJIt9E6zt3D+hKDyX LAlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :arc-authentication-results; bh=FHVyqMQZPr3vOO57PnkXZdR0O5sQaxiz+4ZbJhcRjbE=; b=zUIDW39faVstqQaWZJCsgKBzMVfxShaPfzA6PyCiw07OgUUu+KOvz5VB/YuRkAJQOD FTKDnRDMHn/SVkw9xZ4RushDbazXmB3n6XRDcwbsqvNKbkzA1vz4k6PLnX+DFeGCRLlB +vBVGj44xjQt0SgZBWq0ZudpJZq5R+/YZoS4LzQGEF6bLwJCz5cV5ltJSMNGJLRleqhp 9HQ6yiZTO04e7uy5e8aqLIHJQ1IiCHH0GDwYSTAKPrCSChuSla0oSimY7XF5tmybQBll OFPGwFIkMJzHR3Q/pq5OD2ojRCwWjhRw0RLzI5Y5onIWnAd5LX1LLakwb5z61QVCtil2 Yl3A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id w7si364001ljw.4.2018.02.14.23.28.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 23:28:19 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w1F7SIVc028677 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2018 08:28:19 +0100 Received: from [167.87.36.215] ([167.87.36.215]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w1F7SILr023407; Thu, 15 Feb 2018 08:28:18 +0100 Subject: Re: [PATCH 1/2] meta/classes/base: extend sys.path with lib directory To: "[ext] claudius.heine.ext@siemens.com" , isar-users@googlegroups.com, Henning Schild Cc: Claudius Heine References: <20180214131509.16361-1-claudius.heine.ext@siemens.com> <20180214131509.16361-2-claudius.heine.ext@siemens.com> From: Jan Kiszka Message-ID: Date: Thu, 15 Feb 2018 08:28:18 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20180214131509.16361-2-claudius.heine.ext@siemens.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: Ar9y0eUj4Uyu On 2018-02-14 14:15, [ext] claudius.heine.ext@siemens.com wrote: > From: Claudius Heine > > Currently scripts and modules that are placed in the 'lib' directory of > layers are not available in the recipes. > > This change adds the required code to the base.bbclass in order to have > those imports available. > > This change contains code from: > http://git.openembedded.org/openembedded-core/tree/meta/classes/base.bbclass?id=4a4eff9b9e3c614ff41b17cbec359b72dcbd41bd > > Signed-off-by: Claudius Heine > --- > meta/classes/base.bbclass | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass > index ae84677..3334789 100644 > --- a/meta/classes/base.bbclass > +++ b/meta/classes/base.bbclass > @@ -37,6 +37,30 @@ bbfatal() { > exit 1 > } > > +# Derived from openembedded-core/meta/classes/base.bbclass > +ISAR_IMPORTS += "os sys time" > + > +def isar_imports(d): > + import sys > + > + bbpath = d.getVar("BBPATH").split(":") > + sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath] > + > + def inject(name, value): > + """Make a python object accessible from the metadata""" > + if hasattr(bb.utils, "_context"): > + bb.utils._context[name] = value > + else: > + __builtins__[name] = value > + > + for toimport in d.getVar("ISAR_IMPORTS", True).split(): > + imported = __import__(toimport) > + inject(toimport.split(".", 1)[0], imported) > + > + return "" > + > +ISAR_IMPORTED := "${@isar_imports(d)}" > + > # Derived from bitbake: bitbake/classes/base.bbclass > addtask showdata > do_showdata[nostamp] = "1" > Henning, does this help with selecting wic plugins as well? Or does wic express its search paths differently and would not be affected by this change? Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux