diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-29 14:27:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-30 17:42:39 +0100 |
commit | 432294856418fc40e749552106034b8e14fa5c81 (patch) | |
tree | 3f699f77b04937ce22a3ca6e3ec83864efd1ab61 | |
parent | c7a389729a5453bf090f05946bfa64413a5e04ed (diff) | |
download | ast2050-yocto-poky-432294856418fc40e749552106034b8e14fa5c81.zip ast2050-yocto-poky-432294856418fc40e749552106034b8e14fa5c81.tar.gz |
bitbake: cookerdata: Allow bblayers.conf to be found using BBPATH
It should be possible to run a build anywhere on the filesystem and have
bitbake find the correct build directory if its set somehow. The BBPATH
variable makes perfect sense for this usage. Therefore use any available
value of BBPATH to search for conf/bblayers.conf before walking the parent
directory structure.
This restores the option of being able to run bitbake from anywhere if
the user has set things up to operate in that environment.
(Bitbake rev: e86336b3fe245bc97fe74c9b9d6a21d38a536fb7)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index 8a0bc22..0b278b1 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py @@ -177,14 +177,21 @@ def _inherit(bbclass, data): bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data) return data -def findConfigFile(configfile): +def findConfigFile(configfile, data): + search = [] + bbpath = data.getVar("BBPATH", True) + if bbpath: + for i in bbpath.split(":"): + search.append(os.path.join(i, "conf", configfile)) path = os.getcwd() while path != "/": - confpath = os.path.join(path, "conf", configfile) - if os.path.exists(confpath): - return confpath - + search.append(os.path.join(path, "conf", configfile)) path, _ = os.path.split(path) + + for i in search: + if os.path.exists(i): + return i + return None class CookerDataBuilder(object): @@ -225,8 +232,8 @@ class CookerDataBuilder(object): logger.exception("Error parsing configuration files") sys.exit(1) - def _findLayerConf(self): - return findConfigFile("bblayers.conf") + def _findLayerConf(self, data): + return findConfigFile("bblayers.conf", data) def parseConfigurationFiles(self, prefiles, postfiles): data = self.data @@ -236,7 +243,7 @@ class CookerDataBuilder(object): for f in prefiles: data = parse_config_file(f, data) - layerconf = self._findLayerConf() + layerconf = self._findLayerConf(data) if layerconf: parselog.debug(2, "Found bblayers.conf (%s)", layerconf) # By definition bblayers.conf is in conf/ of TOPDIR. |