aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-25 16:59:09 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-26 12:33:10 +0100
commit437d1e67c538408b2d6e95893da4391219429458 (patch)
tree6ef40940a40912d735a2bfe6fde38204d918f56a
parent73d3c758178ff31aa41ed32eb47b3a5b3d68a33b (diff)
downloadbitbake-master-next.tar.gz
build: Handle conflict between cwd and cleandirsmaster-next
If the cwd of the task is also a cleandirs, you would see warnings from bitbake about being unable to obtain cwd during the task execution. Tweak the code to detect this and avoid the warnings. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/build.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py
index 44d08f5c5..ab8bce3d5 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -197,6 +197,8 @@ def exec_func(func, d, dirs = None):
for cdir in d.expand(cleandirs).split():
bb.utils.remove(cdir, True)
bb.utils.mkdirhier(cdir)
+ if cdir == oldcwd:
+ os.chdir(cdir)
if flags and dirs is None:
dirs = flags.get('dirs')