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 12:35:56 +0100 |
commit | b516394f9e7858062aa7b042aa4a1bdef9d3a941 (patch) | |
tree | 152e06fca4c5a41f2bc7071b0ddf5da902d913d6 | |
parent | f46652e77f467861dc68c3a8e54f27d08659222d (diff) | |
download | openembedded-core-contrib-b516394f9e7858062aa7b042aa4a1bdef9d3a941.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.
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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() { searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/") export2json(d, testdata,searchString=searchString,replaceString="") - if os.path.lexists(testdata_link): - os.remove(testdata_link) - os.symlink(os.path.basename(testdata), testdata_link) + if testdata_link != testdata: + if os.path.lexists(testdata_link): + os.remove(testdata_link) + os.symlink(os.path.basename(testdata), testdata_link) } |