diff options
-rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index ca690a6e59..e816824f28 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass | |||
@@ -316,17 +316,18 @@ rootfs_sysroot_relativelinks () { | |||
316 | python write_image_test_data() { | 316 | python write_image_test_data() { |
317 | from oe.data import export2json | 317 | from oe.data import export2json |
318 | 318 | ||
319 | testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_NAME')) | 319 | deploy_dir = d.getVar('IMGDEPLOYDIR') |
320 | testdata_link = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME')) | 320 | link_name = d.getVar('IMAGE_LINK_NAME') |
321 | testdata_name = os.path.join(deploy_dir, "%s.testdata.json" % d.getVar('IMAGE_NAME')) | ||
321 | 322 | ||
322 | bb.utils.mkdirhier(os.path.dirname(testdata)) | ||
323 | searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/") | 323 | searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/") |
324 | export2json(d, testdata,searchString=searchString,replaceString="") | 324 | export2json(d, testdata_name, searchString=searchString, replaceString="") |
325 | 325 | ||
326 | if testdata_link != testdata: | 326 | if os.path.exists(testdata_name): |
327 | testdata_link = os.path.join(deploy_dir, "%s.testdata.json" % link_name) | ||
327 | if os.path.lexists(testdata_link): | 328 | if os.path.lexists(testdata_link): |
328 | os.remove(testdata_link) | 329 | os.remove(testdata_link) |
329 | os.symlink(os.path.basename(testdata), testdata_link) | 330 | os.symlink(os.path.basename(testdata_name), testdata_link) |
330 | } | 331 | } |
331 | write_image_test_data[vardepsexclude] += "TOPDIR" | 332 | write_image_test_data[vardepsexclude] += "TOPDIR" |
332 | 333 | ||