From: Laurentiu Palcu Date: Fri, 28 Mar 2014 13:07:40 +0000 (+0200) Subject: image.py: check file exists before deleting X-Git-Tag: 2015-4~3200 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=8910d3cc94899ab4d509e681b438ae96218fa777;p=openembedded-core.git 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 Signed-off-by: Richard Purdie --- 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)