]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/externalsrc: fix symlinking if symlink exists pointing to another path
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 2 Mar 2016 10:44:19 +0000 (23:44 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 2 Mar 2016 22:39:07 +0000 (22:39 +0000)
If the oe-workdir / oe-logs symlink exists and points to a different
path then the symlink needs to be removed before calling os.symlink() or
it'll fail.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/externalsrc.bbclass

index b608bd04e8a1b0c4ec14aa05d2dc9faaaf5f3278..0ec338c660e75d07eb6eb65f71d7c43a96e3917d 100644 (file)
@@ -115,6 +115,7 @@ python externalsrc_configure_prefunc() {
                 # Link already exists, leave it if it points to the right location already
                 if os.readlink(lnkfile) == target:
                     continue
+                os.unlink(lnkfile)
             elif os.path.exists(lnkfile):
                 # File/dir exists with same name as link, just leave it alone
                 continue