rootfs-postcommands: handle broken links when writing manifest
If the manifest link is broken then os.path.exists() returns False so the link isn't removed, resulting in the os.symlink() call failing as the file already exists. Prevent this by using os.path.lexists to check that the symlink itself exists, not the target. (From OE-Core rev: 018e3f9f215607a1d7c9fb7780236cc467f3103b) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
2c81e17222
commit
a43991d530
|
@ -225,7 +225,7 @@ python write_image_manifest () {
|
|||
|
||||
if os.path.exists(manifest_name):
|
||||
manifest_link = deploy_dir + "/" + link_name + ".manifest"
|
||||
if os.path.exists(manifest_link):
|
||||
if os.path.lexists(manifest_link):
|
||||
if d.getVar('RM_OLD_IMAGE', True) == "1" and \
|
||||
os.path.exists(os.path.realpath(manifest_link)):
|
||||
os.remove(os.path.realpath(manifest_link))
|
||||
|
@ -275,5 +275,3 @@ rootfs_check_host_user_contaminated () {
|
|||
rootfs_sysroot_relativelinks () {
|
||||
sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue