diff options
Diffstat (limited to 'bitbake/lib/bb/cookerdata.py')
| -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 8a0bc22247..0b278b178e 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
| @@ -177,14 +177,21 @@ def _inherit(bbclass, data): | |||
| 177 | bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data) | 177 | bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data) |
| 178 | return data | 178 | return data |
| 179 | 179 | ||
| 180 | def findConfigFile(configfile): | 180 | def findConfigFile(configfile, data): |
| 181 | search = [] | ||
| 182 | bbpath = data.getVar("BBPATH", True) | ||
| 183 | if bbpath: | ||
| 184 | for i in bbpath.split(":"): | ||
| 185 | search.append(os.path.join(i, "conf", configfile)) | ||
| 181 | path = os.getcwd() | 186 | path = os.getcwd() |
| 182 | while path != "/": | 187 | while path != "/": |
| 183 | confpath = os.path.join(path, "conf", configfile) | 188 | search.append(os.path.join(path, "conf", configfile)) |
| 184 | if os.path.exists(confpath): | ||
| 185 | return confpath | ||
| 186 | |||
| 187 | path, _ = os.path.split(path) | 189 | path, _ = os.path.split(path) |
| 190 | |||
| 191 | for i in search: | ||
| 192 | if os.path.exists(i): | ||
| 193 | return i | ||
| 194 | |||
| 188 | return None | 195 | return None |
| 189 | 196 | ||
| 190 | class CookerDataBuilder(object): | 197 | class CookerDataBuilder(object): |
| @@ -225,8 +232,8 @@ class CookerDataBuilder(object): | |||
| 225 | logger.exception("Error parsing configuration files") | 232 | logger.exception("Error parsing configuration files") |
| 226 | sys.exit(1) | 233 | sys.exit(1) |
| 227 | 234 | ||
| 228 | def _findLayerConf(self): | 235 | def _findLayerConf(self, data): |
| 229 | return findConfigFile("bblayers.conf") | 236 | return findConfigFile("bblayers.conf", data) |
| 230 | 237 | ||
| 231 | def parseConfigurationFiles(self, prefiles, postfiles): | 238 | def parseConfigurationFiles(self, prefiles, postfiles): |
| 232 | data = self.data | 239 | data = self.data |
| @@ -236,7 +243,7 @@ class CookerDataBuilder(object): | |||
| 236 | for f in prefiles: | 243 | for f in prefiles: |
| 237 | data = parse_config_file(f, data) | 244 | data = parse_config_file(f, data) |
| 238 | 245 | ||
| 239 | layerconf = self._findLayerConf() | 246 | layerconf = self._findLayerConf(data) |
| 240 | if layerconf: | 247 | if layerconf: |
| 241 | parselog.debug(2, "Found bblayers.conf (%s)", layerconf) | 248 | parselog.debug(2, "Found bblayers.conf (%s)", layerconf) |
| 242 | # By definition bblayers.conf is in conf/ of TOPDIR. | 249 | # By definition bblayers.conf is in conf/ of TOPDIR. |
