Skip to contentSkip to conversation

image.py: check file exists before deleting

PATCH New Laurentiu Palcu 1 participant 2 messages Mar 28, 2014

lore
Share & tools
lore
#0 lore raw

cover image.py: check file exists before deleting

The following changes since commit 8c3eb5ee4582b6f6d489549290937657f37fc19e:

packagegroup-toolset-native: Update after ocf-linux -> cryptodev-linux change (2014-03-27 19:53:30 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib lpalcu/b6029_ignore_broken_symlinks
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=lpalcu/b6029_ignore_broken_symlinks

Laurentiu Palcu (1):
image.py: check file exists before deleting

 meta/lib/oe/image.py |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 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]

---
 meta/lib/oe/image.py |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oe/image.py +2 -1
index a03b73e..c9b9033 100644
@@ -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)
Signature · 1 line
1.7.9.5