[oe-commits] [openembedded-core] 01/36: base.bbclass: clean up dead symlink when handling hosttools

git at git.openembedded.org git at git.openembedded.org
Mon Dec 30 08:48:06 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit b03577cf85784fc052b89083054d911816f8c6e1
Author: Chen Qi <Qi.Chen at windriver.com>
AuthorDate: Wed Dec 25 15:01:13 2019 +0800

    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 at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/base.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 145daea..5e5cf66 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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list