bitbake.conf: rework FILESPATH generation.
authorChris Larson <clarson@mvista.com>
Thu, 19 Feb 2009 22:51:57 +0000 (15:51 -0700)
committerChris Larson <clarson@kergoth.com>
Sun, 22 Mar 2009 03:06:30 +0000 (20:06 -0700)
Rework FILESPATH generation to be done in bitbake.conf, avoiding the
confusion about it being in multiple places.  Adds FILESPATHBASE and
FILESPATHPKG which can be manipulated rather than manipulating FILESPATH
directly.

One usage possibility:

FILESPATHBASE =. "${TOPDIR}/files:"

Which would let me provide a custom busybox config for this build by
copying the defconfig from the openembedded metadata into my
build/files/busybox-1.0/ directory, for example.

Signed-off-by: Chris Larson <clarson@mvista.com>
classes/base.bbclass
conf/bitbake.conf

index f1fee83..1b61895 100644 (file)
@@ -180,18 +180,6 @@ def base_package_name(d):
 
   return pn
 
-def base_set_filespath(path, d):
-       import os, bb
-       filespath = []
-       # The ":" ensures we have an 'empty' override
-       overrides = (bb.data.getVar("OVERRIDES", d, 1) or "") + ":"
-       for p in path:
-               for o in overrides.split(":"):
-                       filespath.append(os.path.join(p, o))
-       return ":".join(filespath)
-
-FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}"
-
 def oe_filter(f, str, d):
        from re import match
        return " ".join(filter(lambda x: match(f, x, 0), str.split()))
index 68301bc..7954b8d 100644 (file)
@@ -231,9 +231,11 @@ FILES_${PN}-locale = "${datadir}/locale"
 
 export MANIFEST = "${FILESDIR}/manifest"
 
+# file:// search paths
 FILE_DIRNAME = "${@os.path.dirname(bb.data.getVar('FILE', d))}"
-FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/${BP}:${FILE_DIRNAME}/${BPN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
-FILESDIR = "${@bb.which(bb.data.getVar('FILESPATH', d, 1), '.')}"
+FILESPATHBASE = "${FILE_DIRNAME}"
+FILESPATHPKG = "${PF}:${P}:${PN}:${BP}:${BPN}:files:."
+FILESPATH = "${@':'.join(['%s/%s/%s' % (fp, p, o) for fp in d.getVar('FILESPATHBASE', 0).split(':') for p in d.getVar('FILESPATHPKG', 0).split(':') for o in (d.getVar('OVERRIDES', 0) + ':.').split(':')])}:${FILESDIR}"
 
 ##################################################################
 # General work and output directories for the build system.