summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2019-12-25 15:01:13 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-30 08:45:02 +0000
commitb03577cf85784fc052b89083054d911816f8c6e1 (patch)
treea16929d6f9088cbc3225f97f6345946da46a1372 /meta/classes
parent39825cba4761a6b4b2473825705975f9f421ec8b (diff)
downloadopenembedded-core-b03577cf85784fc052b89083054d911816f8c6e1.tar.gz
base.bbclass: clean up dead symlink when handling hosttools
When some hosttool is a dead symlink, bitbake any recipe will fail with error like below. FileExistsError: [Errno 17] File exists: '/usr/bin/chrpath' -> '/path/to/builddir/tmp-glibc/hosttools/chrpath' So we remove dead symlink under hostools/ directory to avoid such error. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/base.bbclass3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 145daea3ec..5e5cf66322 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -127,6 +127,9 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
for tool in tools:
desttool = os.path.join(dest, tool)
if not os.path.exists(desttool):
+ # clean up dead symlink
+ if os.path.islink(desttool):
+ os.unlink(desttool)
srctool = bb.utils.which(path, tool, executable=True)
# gcc/g++ may link to ccache on some hosts, e.g.,
# /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc)