From: Paul Eggleton Date: Wed, 2 Mar 2016 10:44:19 +0000 (+1300) Subject: classes/externalsrc: fix symlinking if symlink exists pointing to another path X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~26714 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb8f064e48c24dcb1a15a32cef3399f35e549bdc;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git classes/externalsrc: fix symlinking if symlink exists pointing to another path 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 Signed-off-by: Richard Purdie --- diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index b608bd04e8a..0ec338c660e 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass @@ -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