aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2014-03-28 15:07:40 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-28 13:43:04 +0000
commit8910d3cc94899ab4d509e681b438ae96218fa777 (patch)
treee02e80db68813adcb9d1c511ce3517b8cf3f519d
parent76bbf9e8f07f3e6f20c890dd4c82c72641e2ca88 (diff)
downloadopenembedded-core-contrib-8910d3cc94899ab4d509e681b438ae96218fa777.tar.gz
image.py: check file exists before deleting
When RM_OLD_IMAGE = "1", we delete old images but we didn't check they actually exist... [YOCTO #6029] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/image.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
index a03b73e4c0..c9b9033132 100644
--- a/meta/lib/oe/image.py
+++ b/meta/lib/oe/image.py
@@ -192,7 +192,8 @@ class Image(ImageDepGraph):
if img.find(self.d.getVar('IMAGE_LINK_NAME', True)) == 0:
img = os.path.join(deploy_dir, img)
if os.path.islink(img):
- if self.d.getVar('RM_OLD_IMAGE', True) == "1":
+ if self.d.getVar('RM_OLD_IMAGE', True) == "1" and \
+ os.path.exists(os.path.realpath(img)):
os.remove(os.path.realpath(img))
os.remove(img)