summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
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:47:09 +0000
commit4480d7a3c583faa15d16a7b109646bf735bb79dd (patch)
tree78fff33cb97679ab1800ee9e7f1530e16120af33 /meta/classes/base.bbclass
parent3780744968f0b26cc2f4fea61a0cc594da6fa616 (diff)
downloadpoky-4480d7a3c583faa15d16a7b109646bf735bb79dd.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. (From OE-Core rev: b03577cf85784fc052b89083054d911816f8c6e1) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-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):
127 for tool in tools: 127 for tool in tools:
128 desttool = os.path.join(dest, tool) 128 desttool = os.path.join(dest, tool)
129 if not os.path.exists(desttool): 129 if not os.path.exists(desttool):
130 # clean up dead symlink
131 if os.path.islink(desttool):
132 os.unlink(desttool)
130 srctool = bb.utils.which(path, tool, executable=True) 133 srctool = bb.utils.which(path, tool, executable=True)
131 # gcc/g++ may link to ccache on some hosts, e.g., 134 # gcc/g++ may link to ccache on some hosts, e.g.,
132 # /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc) 135 # /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc)