From: Vijai Kumar K <
Vijaikumar_...@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_...@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