summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Looijmans <mike.looijmans@topic.nl>2017-08-17 12:49:49 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-29 12:22:06 +0100
commit9842f64154e633c198b201fae01dbab1fb04c74e (patch)
treea222758c5a4751453b7dfe3bb78044249d0f1e62
parent87b52832e82f51b3bb9430f709815b4f14d649f8 (diff)
downloadpoky-9842f64154e633c198b201fae01dbab1fb04c74e.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: f8ceec50af68650d6548738e5b5582e2b25424d7) 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.bbclass7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 498174a664..c194b264e0 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -298,7 +298,8 @@ python write_image_test_data() {
298 searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/") 298 searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
299 export2json(d, testdata,searchString=searchString,replaceString="") 299 export2json(d, testdata,searchString=searchString,replaceString="")
300 300
301 if os.path.lexists(testdata_link): 301 if testdata_link != testdata:
302 os.remove(testdata_link) 302 if os.path.lexists(testdata_link):
303 os.symlink(os.path.basename(testdata), testdata_link) 303 os.remove(testdata_link)
304 os.symlink(os.path.basename(testdata), testdata_link)
304} 305}