public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] meta: Add support for FILESEXTRAPATHS
@ 2019-10-03 13:54 vijaikumar.kanagarajan
  2019-10-04  7:30 ` Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: vijaikumar.kanagarajan @ 2019-10-03 13:54 UTC (permalink / raw)
  To: isar-users
  Cc: henning.schild, ibr, claudius.heine.ext, jan.kiszka, Vijai Kumar K

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.

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)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-10-15  9:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-03 13:54 [PATCH] meta: Add support for FILESEXTRAPATHS vijaikumar.kanagarajan
2019-10-04  7:30 ` Jan Kiszka
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox