mirror of
https://git.yoctoproject.org/poky
synced 2026-04-13 14:02:21 +02:00
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] (From OE-Core rev: 8910d3cc94899ab4d509e681b438ae96218fa777) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
0f757af31f
commit
5b594449f7
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user