* it was removing only destination symlinks, but sometimes hardlink might be regenerated
as well, e.g. in oeqa test wic.Wic.test_permissions which was failing with:
NOTE: recipe core-image-minimal-1.0-r0: task do_image_wic: Started
ERROR: core-image-minimal-1.0-r0 do_image_wic: Error executing a python function in exec_func_python() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:create_hardlinks(d)
0003:
File: '/OE/build/poky/meta/classes-recipe/image.bbclass', lineno: 606, function: create_hardlinks
0602: if os.path.exists(src):
0603: bb.note("Creating hardlink: %s -> %s" % (dst, src))
0604: if os.path.islink(dst):
0605: os.remove(dst)
*** 0606: os.link(src, dst)
0607: else:
0608: bb.note("Skipping hardlink, source does not exist: %s -> %s" % (dst, src))
0609:}
0610:
Exception: FileExistsError: [Errno 17] File exists: 'tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/deploy-core-image-minimal-image-complete/core-image-minimal-qemux86-64.rootfs.wic' -> 'tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/deploy-core-image-minimal-image-complete/core-image-minimal-qemux86-64.rootfs--1.0-r0-
20110405230000.wic'
[YOCTO #12937]
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>