summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-29 14:26:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-30 17:38:17 +0100
commitb266db27de0bba19a418e4d42e870649136b116b (patch)
tree7efdb41c107250aa4510671aae2fecfd7f4698e3
parentbf9be2029b2bded5f532bdda4c38ae3dff5d1cf6 (diff)
downloadbitbake-b266db27de0bba19a418e4d42e870649136b116b.tar.gz
cookerdata: Set TOPDIR when using bblayers.conf
By definition, bblayers.conf is at the top of the build tree. We'd like to support running bitbake anywhere within that build tree but TOPDIR gets set to wherever cwd is. Change the code to reset TOPDIR to the top of the build directory. This shouldn't break anything but does make the system more usable. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/cookerdata.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
index a0379cf7f..8a0bc2224 100644
--- a/lib/bb/cookerdata.py
+++ b/lib/bb/cookerdata.py
@@ -239,6 +239,9 @@ class CookerDataBuilder(object):
layerconf = self._findLayerConf()
if layerconf:
parselog.debug(2, "Found bblayers.conf (%s)", layerconf)
+ # By definition bblayers.conf is in conf/ of TOPDIR.
+ # We may have been called with cwd somewhere else so reset TOPDIR
+ data.setVar("TOPDIR", os.path.dirname(os.path.dirname(layerconf)))
data = parse_config_file(layerconf, data)
layers = (data.getVar('BBLAYERS', True) or "").split()