aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/parse
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-13 16:19:49 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-13 16:28:34 +0000
commitadd5d488e1d6607a98441836075d01cb1dc9c0fa (patch)
tree35cd981d9a163429d3a189f40472bdde9840fd86 /lib/bb/parse
parentc03df5283408dfd089b6317677d2b7af6fa73936 (diff)
downloadbitbake-add5d488e1d6607a98441836075d01cb1dc9c0fa.tar.gz
cache/ConfHandler: Drop TOPDIR/chdir manipulations
This code has been unchanged since 2006 apart from attempts to optimise performance by minimising chdir() calls. There is no reason the modern bitbake parser should be changing directory all the time. We did have some path assumptions in the mists of time but those were resovled and the code is deterministic and doesn't depend on cwd now for parsing. We can therefore drop the changes in directory. Also, TOPDIR is now being set by cookerdata in all cases so we don't need the fallbacks in this code (which was used to effectively initialise a value). We don't need to change TOPDIR when parsing a recipe, that makes no sense. If we stop all the other messing around, we don't need to expand TMPDIR either. These changes have the potential to break some obscure use cases such as an anonymous function assuming the current working directory, or some case which depends on TOPDIR changing but I believe any such uses should be fixed at this point. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/parse')
-rw-r--r--lib/bb/parse/parse_py/ConfHandler.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/bb/parse/parse_py/ConfHandler.py b/lib/bb/parse/parse_py/ConfHandler.py
index 0834fe3f9..b895d5b5e 100644
--- a/lib/bb/parse/parse_py/ConfHandler.py
+++ b/lib/bb/parse/parse_py/ConfHandler.py
@@ -48,10 +48,7 @@ __unset_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)$" )
__unset_flag_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)\[([a-zA-Z0-9\-_+.]+)\]$" )
def init(data):
- topdir = data.getVar('TOPDIR', False)
- if not topdir:
- data.setVar('TOPDIR', os.getcwd())
-
+ return
def supports(fn, d):
return fn[-5:] == ".conf"