diff options
author | Mike Looijmans <mike.looijmans@topic.nl> | 2017-08-17 12:49:49 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-18 23:46:37 +0100 |
commit | 88a82e74899b4152fcbda9e88aa1e8e77701b5e2 (patch) | |
tree | f00e04a3ff4124a600720e3538db979dfcc7e4dc /meta/classes | |
parent | 322985be2367cdbeda6ede9d54f18ddd9b73a4da (diff) | |
download | poky-88a82e74899b4152fcbda9e88aa1e8e77701b5e2.tar.gz |
rootfs-postcommands.bbclass: Prevent linking testdata to itself
testdata and testdata_link may point to the same file, in particular
when IMAGE_LINK_NAME and IMAGE_NAME are equal.
Check if this is the case before creating a symlink that points to
itself and makes the next build fail.
(From OE-Core rev: b516394f9e7858062aa7b042aa4a1bdef9d3a941)
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 78f7c55933..c92df7b0de 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass | |||
@@ -300,7 +300,8 @@ python write_image_test_data() { | |||
300 | searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/") | 300 | searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/") |
301 | export2json(d, testdata,searchString=searchString,replaceString="") | 301 | export2json(d, testdata,searchString=searchString,replaceString="") |
302 | 302 | ||
303 | if os.path.lexists(testdata_link): | 303 | if testdata_link != testdata: |
304 | os.remove(testdata_link) | 304 | if os.path.lexists(testdata_link): |
305 | os.symlink(os.path.basename(testdata), testdata_link) | 305 | os.remove(testdata_link) |
306 | os.symlink(os.path.basename(testdata), testdata_link) | ||
306 | } | 307 | } |