[OE-core] [PATCH v2] wic/direct.py: Avoid exception if using multiple rawcopy/no-table entries.

Kristian Amlie kristian.amlie at mender.io
Thu Mar 9 14:37:09 UTC 2017


If we are both having a bootloader and a U-Boot environment file, we
can end up with two entries using "--source rawcopy" and "--no-table",
and since they reuse the same file [1], their cleanup handlers will
try to delete the same file twice. So make sure we only do it once.

[1] Although they reuse the same file, the resulting output is
correct, so it appears the file is accessed in properly sequential
order.

Signed-off-by: Kristian Amlie <kristian.amlie at mender.io>
---
 scripts/lib/wic/plugins/imager/direct.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 481d24d..67450a2 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -548,7 +548,7 @@ class PartitionedImage():
 
     def cleanup(self):
         # remove partition images
-        for image in self.partimages:
+        for image in set(self.partimages):
             os.remove(image)
 
     def assemble(self):
-- 
2.7.4




More information about the Openembedded-core mailing list