diff options
| -rw-r--r-- | bitbake/lib/bb/cookerdata.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index c2aeee63fb..6511dcbfad 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
| @@ -230,6 +230,27 @@ def findConfigFile(configfile, data): | |||
| 230 | 230 | ||
| 231 | return None | 231 | return None |
| 232 | 232 | ||
| 233 | # | ||
| 234 | # We search for a conf/bblayers.conf under an entry in BBPATH or in cwd working | ||
| 235 | # up to /. If that fails, we search for a conf/bitbake.conf in BBPATH. | ||
| 236 | # | ||
| 237 | |||
| 238 | def findTopdir(): | ||
| 239 | d = bb.data.init() | ||
| 240 | bbpath = None | ||
| 241 | if 'BBPATH' in os.environ: | ||
| 242 | bbpath = os.environ['BBPATH'] | ||
| 243 | d.setVar('BBPATH', bbpath) | ||
| 244 | |||
| 245 | layerconf = findConfigFile("bblayers.conf", d) | ||
| 246 | if layerconf: | ||
| 247 | return os.path.dirname(os.path.dirname(layerconf)) | ||
| 248 | if bbpath: | ||
| 249 | bitbakeconf = bb.utils.which(bbpath, "conf/bitbake.conf") | ||
| 250 | if bitbakeconf: | ||
| 251 | return os.path.dirname(os.path.dirname(bitbakeconf)) | ||
| 252 | return None | ||
| 253 | |||
| 233 | class CookerDataBuilder(object): | 254 | class CookerDataBuilder(object): |
| 234 | 255 | ||
| 235 | def __init__(self, cookercfg, worker = False): | 256 | def __init__(self, cookercfg, worker = False): |
