From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6743574894420688896 X-Received: by 2002:a2e:5d17:: with SMTP id r23mr8886027ljb.229.1570174930271; Fri, 04 Oct 2019 00:42:10 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:47d5:: with SMTP id u204ls1159206lja.5.gmail; Fri, 04 Oct 2019 00:42:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxylZhR6XTk7HqQd3ipI277yuwKrSR5B9QIoBtt3k9TGoqZbMdX1ISCKy0XdIuCXer49tBZ X-Received: by 2002:a2e:301a:: with SMTP id w26mr8610999ljw.168.1570174929601; Fri, 04 Oct 2019 00:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570174929; cv=none; d=google.com; s=arc-20160816; b=FW48fiAabu9pgVm4XK60IE7gTYJ7bpoqRLJ8bylspslJffeNugJWU2AWp6c1im7YxD RWA0sdj7oiMvaoxC7/DlAKE1hoTO/NiiJB9AxddF5wzkdCrd952QPzDSrnL/zo3ef7F5 JxrbA/EtymtmmAp/NlW9tOtiqHYKoORrNzR37Uage7RuaO4fz8PwW5b1ucrJCJzGigvq ZjVDaRPPayr8qeSYZ/KUWa37vWSNYaozpUgHYjqZ0SfY8zr6n3lZs81+c4SZWHYQ8cz/ HqICO0ozXq3vhHDZ+RWrJSU8et2YQN04I04ZCMlG5GkIYrMpyFMKn/hp2+rjdzCgulHO OzHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:date:from:dkim-signature; bh=ulDIG7D2xlPUCETeqWruEmHNuuV9fp8DF1DWeqIAVug=; b=IjwYi0COYKS95W+BWeqcrJQJvIm1zzWI4Sgl0dtatEys+5sRTY2DTMkLxqTfYM9jbB 2uooYyzn7+Hcb/IgJT/SdTDZ7bKnJNjyN1g/7RmdhrnXyRCcmErPUP1S/DfNUl36GPCY G95l/FHjHaJ6h96uONtqsjo8bHI5XFmqBbjh3B0mOdpwCyITGwMbDDUUMnRSTevYbe2y Ru0q6wvKrfj7CRZf1CzaXku4DAaCEwvxXs8uh0qlQzpIteSaTAJXpeME9Wt1iuRj8YJs rWMDdx7BM3p5tlvtVf5yJftpeqV4PPXvyqgvMuEpkL80yfkwBH3HwqwzQ1jPmaEbmkqT r5AA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="R9NX/9Z7"; spf=pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::342 as permitted sender) smtp.mailfrom=vijaikumar.kanagarajan@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com. [2a00:1450:4864:20::342]) by gmr-mx.google.com with ESMTPS id a9si336196lfk.5.2019.10.04.00.42.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Oct 2019 00:42:09 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::342 as permitted sender) client-ip=2a00:1450:4864:20::342; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="R9NX/9Z7"; spf=pass (google.com: domain of vijaikumar.kanagarajan@gmail.com designates 2a00:1450:4864:20::342 as permitted sender) smtp.mailfrom=vijaikumar.kanagarajan@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: by mail-wm1-x342.google.com with SMTP id r19so4688139wmh.2 for ; Fri, 04 Oct 2019 00:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ulDIG7D2xlPUCETeqWruEmHNuuV9fp8DF1DWeqIAVug=; b=R9NX/9Z7BuTXn8hkvMT6lNVNIPAlZGbOO8uv6u/AC30q52gaGaKs7TS7gIGhj+Gwp7 hYw8sGEilXSpHPc155nkGjmVTEtj/QLRqV6NWF1enWwyoY5gTFhPN0DH2/R1g74kLjLr F4ruFkU2tG8jDPikAEj507FKINTxLglyJo2tMz/3xcKzG6/m/yjUcp9V9vQFjo3lXLp3 uKoxYJJ4NA8JT197tiVPYv7eMavYr1w8Y1sQCLElKiydhWxyHaxROFwa8oY2Cg8Dm3Gz FJNHkBczlrfCdUq9adIS14VB8HZD8HxsgRlMo2auFb47eUk98KU+dXdWVhzvJ2qQwhwb yVTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ulDIG7D2xlPUCETeqWruEmHNuuV9fp8DF1DWeqIAVug=; b=kfMVGFP+VHLMEtdhllWjC9EjL+kLrEkWEA4LP2HUIVBPSjrvM7lKlRYi8jkT8EkqgE m/tJ8PugwYNVoiaROi0ov4SYT0vsJLKz/MehqfA1C+D03JcpaNz1ca+Rh+1rN3MbhnxU D0mOYq550Xpc6ah8DPtm9sTB9/enuH8NRvyd7ZZzp9ecFmRScF7o1Av2SXx/xyqyzl72 4ZsthbJdgukR1A+zD4i1yrIW0YMpT7B6CpmfxBOVV/G+3G7Qs23ncX/j1hR743VcBKWh EHXl8CgMSCoDqj6Yk86/URD8jp2zWw1/605bmqRTqvWrOi98k3s3aXcjcqIoXnmh5lI6 FEQw== X-Gm-Message-State: APjAAAX00A7UQaIW9wYgcWl2g0SEW4BnLV31zlZH4vIsN+HC74vMCaQj oh5DbnyswB36koNweTD/Abo= X-Received: by 2002:a7b:c391:: with SMTP id s17mr10180591wmj.94.1570174928458; Fri, 04 Oct 2019 00:42:08 -0700 (PDT) Return-Path: Received: from lightning (nat-sch.mentorg.com. [139.181.36.34]) by smtp.gmail.com with ESMTPSA id 10sm3969156wmo.2.2019.10.04.00.42.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Oct 2019 00:42:07 -0700 (PDT) From: Vijai Kumar K X-Google-Original-From: Vijai Kumar K Date: Fri, 4 Oct 2019 13:12:02 +0530 To: Jan Kiszka Cc: vijaikumar.kanagarajan@gmail.com, isar-users@googlegroups.com, henning.schild@siemens.com, ibr@radix50.net, claudius.heine.ext@siemens.com Subject: Re: [PATCH] meta: Add support for FILESEXTRAPATHS Message-ID: <20191004074202.GA14421@lightning> References: <20191003135431.26829-1-Vijaikumar_Kangarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-TUID: dpTXQ2c4cSB1 On Fri, Oct 04, 2019 at 09:30:17AM +0200, Jan Kiszka wrote: > On 03.10.19 15:54, vijaikumar.kanagarajan@gmail.com wrote: > > From: Vijai Kumar K > > > > OE-core provides FILESEXTRAPATHS to extend the search path for > > files and patches. This is particularly useful when you want to > > add more files or replace existing files using bbappend. > > > > Bring in support for FILESEXTRAPATHS from OE-core. > > Technically, this is not needed, prepending FILESPATH directly also works. > It might still be a good idea to add this for conformance with OE. Right now, yes, we might not need it. We could use the FILESPATH_prepend like you suggested. But one case which came to my mind while testing both the solutions is that you could manipulate the order of FILESPATH with FILESEXTRAPATHS and FILESOVERRIDES. This was particularly useful when I want to replace a file only for particular distro or a particular machine. Thanks, Vijai Kumar K > > But as this is no a bitbake interface, it should be documented. Also FILESOVERRIDES. > > Jan > > > > > Signed-off-by: Vijai Kumar K > > --- > > bitbake/conf/bitbake.conf | 3 ++- > > meta/classes/base.bbclass | 19 +++++++++++++++++++ > > 2 files changed, 21 insertions(+), 1 deletion(-) > > > > diff --git a/bitbake/conf/bitbake.conf b/bitbake/conf/bitbake.conf > > index a460df4..9894ed3 100644 > > --- a/bitbake/conf/bitbake.conf > > +++ b/bitbake/conf/bitbake.conf > > @@ -24,12 +24,13 @@ DEPENDS = "" > > DEPLOY_DIR = "${TMPDIR}/deploy" > > DEPLOY_DIR_IMAGE = "${DEPLOY_DIR}/images" > > DL_DIR = "${TMPDIR}/downloads" > > -FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}" > > FILE_DIRNAME = "${@os.path.dirname(d.getVar('FILE', False))}" > > +FILESEXTRAPATHS ?= "__default:" > > GITDIR = "${DL_DIR}/git" > > IMAGE_CMD = "_NO_DEFINED_IMAGE_TYPES_" > > IMAGE_ROOTFS = "${TMPDIR}/rootfs" > > OVERRIDES = "local:${MACHINE}:${TARGET_OS}:${TARGET_ARCH}" > > +FILESOVERRIDES = "local:${MACHINE}:${TARGET_OS}:${TARGET_ARCH}" > > P = "${PN}-${PV}" > > PERSISTENT_DIR = "${TMPDIR}/cache" > > PF = "${PN}-${PV}-${PR}" > > diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass > > index 8c7b021..0670430 100644 > > --- a/meta/classes/base.bbclass > > +++ b/meta/classes/base.bbclass > > @@ -19,6 +19,7 @@ > > # OTHER DEALINGS IN THE SOFTWARE. > > THISDIR = "${@os.path.dirname(d.getVar('FILE', True))}" > > +FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${PF}","${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files","${FILE_DIRNAME}"], d)}" > > def get_deb_host_arch(): > > import subprocess > > @@ -222,3 +223,21 @@ python do_cleanall() { > > except bb.fetch2.BBFetchException as e: > > bb.fatal(str(e)) > > } > > + > > +# Derived from OpenEmbedded Core: meta/classes/utils.bbclass > > +def base_set_filespath(path, d): > > + filespath = [] > > + extrapaths = (d.getVar("FILESEXTRAPATHS") or "") > > + # Remove default flag which was used for checking > > + extrapaths = extrapaths.replace("__default:", "") > > + # Don't prepend empty strings to the path list > > + if extrapaths != "": > > + path = extrapaths.split(":") + path > > + # The ":" ensures we have an 'empty' override > > + overrides = (":" + (d.getVar("FILESOVERRIDES") or "")).split(":") > > + overrides.reverse() > > + for o in overrides: > > + for p in path: > > + if p != "": > > + filespath.append(os.path.join(p, o)) > > + return ":".join(filespath) > > > > -- > Siemens AG, Corporate Technology, CT RDA IOT SES-DE > Corporate Competence Center Embedded Linux