public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: vijaikumar.kanagarajan@gmail.com, isar-users@googlegroups.com
Cc: henning.schild@siemens.com, ibr@radix50.net,
	claudius.heine.ext@siemens.com,
	Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
Subject: Re: [PATCH] meta: Add support for FILESEXTRAPATHS
Date: Fri, 4 Oct 2019 09:30:17 +0200	[thread overview]
Message-ID: <ab73c969-3d45-186b-59fd-c630f29a96bf@siemens.com> (raw)
In-Reply-To: <20191003135431.26829-1-Vijaikumar_Kangarajan@mentor.com>

On 03.10.19 15:54, vijaikumar.kanagarajan@gmail.com wrote:
> From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> 
> 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.

But as this is no a bitbake interface, it should be documented. Also FILESOVERRIDES.

Jan

> 
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
>   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

  reply	other threads:[~2019-10-04  7:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 13:54 vijaikumar.kanagarajan
2019-10-04  7:30 ` Jan Kiszka [this message]
2019-10-04  7:42   ` Vijai Kumar K
2019-10-04  8:45   ` [PATCH v2] " vijaikumar.kanagarajan
2019-10-07  9:37     ` Baurzhan Ismagulov
2019-10-14  6:40       ` Vijai Kumar K
2019-10-14  7:49         ` Jan Kiszka
2019-10-14  7:51           ` Jan Kiszka
2019-10-15  9:41           ` Vijai Kumar K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab73c969-3d45-186b-59fd-c630f29a96bf@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=Vijaikumar_Kanagarajan@mentor.com \
    --cc=claudius.heine.ext@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=ibr@radix50.net \
    --cc=isar-users@googlegroups.com \
    --cc=vijaikumar.kanagarajan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox