aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-04-13 12:14:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-14 10:58:27 +0100
commit018e3f9f215607a1d7c9fb7780236cc467f3103b (patch)
treeea9841d7dc24a0e227daea059735a2902a890484
parentb4744ffb94f76f2be138f2f9bd04153034bf62df (diff)
downloadopenembedded-core-contrib-018e3f9f215607a1d7c9fb7780236cc467f3103b.tar.gz
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. Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/classes/rootfs-postcommands.bbclass4
1 files changed, 1 insertions, 3 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 56e810fd6f..95d28afa30 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -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}
}
-
-