diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2014-03-28 15:07:40 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-30 10:10:33 +0100 |
commit | 5b594449f73f6cff99695119eb00ee5dcc672aed (patch) | |
tree | f03af84449869f17af24b8f86a20e9494604f550 /meta/lib/oe | |
parent | 0f757af31fc4c0e36cb8cf6054e59b4213c73b24 (diff) | |
download | poky-5b594449f73f6cff99695119eb00ee5dcc672aed.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]
(From OE-Core rev: 8910d3cc94899ab4d509e681b438ae96218fa777)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/image.py | 3 |
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): | |||
192 | if img.find(self.d.getVar('IMAGE_LINK_NAME', True)) == 0: | 192 | if img.find(self.d.getVar('IMAGE_LINK_NAME', True)) == 0: |
193 | img = os.path.join(deploy_dir, img) | 193 | img = os.path.join(deploy_dir, img) |
194 | if os.path.islink(img): | 194 | if os.path.islink(img): |
195 | if self.d.getVar('RM_OLD_IMAGE', True) == "1": | 195 | if self.d.getVar('RM_OLD_IMAGE', True) == "1" and \ |
196 | os.path.exists(os.path.realpath(img)): | ||
196 | os.remove(os.path.realpath(img)) | 197 | os.remove(os.path.realpath(img)) |
197 | 198 | ||
198 | os.remove(img) | 199 | os.remove(img) |