diff options
Diffstat (limited to 'bitbake')
| -rw-r--r-- | bitbake/lib/bb/cache.py | 29 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 5 |
2 files changed, 5 insertions, 29 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 4e08c100ab..fcb15796cc 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
| @@ -284,36 +284,15 @@ def parse_recipe(bb_data, bbfile, appends, mc=''): | |||
| 284 | Parse a recipe | 284 | Parse a recipe |
| 285 | """ | 285 | """ |
| 286 | 286 | ||
| 287 | chdir_back = False | ||
| 288 | |||
| 289 | bb_data.setVar("__BBMULTICONFIG", mc) | 287 | bb_data.setVar("__BBMULTICONFIG", mc) |
| 290 | 288 | ||
| 291 | # expand tmpdir to include this topdir | ||
| 292 | bb_data.setVar('TMPDIR', bb_data.getVar('TMPDIR') or "") | ||
| 293 | bbfile_loc = os.path.abspath(os.path.dirname(bbfile)) | 289 | bbfile_loc = os.path.abspath(os.path.dirname(bbfile)) |
| 294 | oldpath = os.path.abspath(os.getcwd()) | ||
| 295 | bb.parse.cached_mtime_noerror(bbfile_loc) | 290 | bb.parse.cached_mtime_noerror(bbfile_loc) |
| 296 | 291 | ||
| 297 | # The ConfHandler first looks if there is a TOPDIR and if not | 292 | if appends: |
| 298 | # then it would call getcwd(). | 293 | bb_data.setVar('__BBAPPEND', " ".join(appends)) |
| 299 | # Previously, we chdir()ed to bbfile_loc, called the handler | 294 | bb_data = bb.parse.handle(bbfile, bb_data) |
| 300 | # and finally chdir()ed back, a couple of thousand times. We now | 295 | return bb_data |
| 301 | # just fill in TOPDIR to point to bbfile_loc if there is no TOPDIR yet. | ||
| 302 | if not bb_data.getVar('TOPDIR', False): | ||
| 303 | chdir_back = True | ||
| 304 | bb_data.setVar('TOPDIR', bbfile_loc) | ||
| 305 | try: | ||
| 306 | if appends: | ||
| 307 | bb_data.setVar('__BBAPPEND', " ".join(appends)) | ||
| 308 | bb_data = bb.parse.handle(bbfile, bb_data) | ||
| 309 | if chdir_back: | ||
| 310 | os.chdir(oldpath) | ||
| 311 | return bb_data | ||
| 312 | except: | ||
| 313 | if chdir_back: | ||
| 314 | os.chdir(oldpath) | ||
| 315 | raise | ||
| 316 | |||
| 317 | 296 | ||
| 318 | 297 | ||
| 319 | class NoCache(object): | 298 | class NoCache(object): |
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index 0834fe3f9b..b895d5b5ef 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py | |||
| @@ -48,10 +48,7 @@ __unset_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)$" ) | |||
| 48 | __unset_flag_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)\[([a-zA-Z0-9\-_+.]+)\]$" ) | 48 | __unset_flag_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)\[([a-zA-Z0-9\-_+.]+)\]$" ) |
| 49 | 49 | ||
| 50 | def init(data): | 50 | def init(data): |
| 51 | topdir = data.getVar('TOPDIR', False) | 51 | return |
| 52 | if not topdir: | ||
| 53 | data.setVar('TOPDIR', os.getcwd()) | ||
| 54 | |||
| 55 | 52 | ||
| 56 | def supports(fn, d): | 53 | def supports(fn, d): |
| 57 | return fn[-5:] == ".conf" | 54 | return fn[-5:] == ".conf" |
