]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic/direct.py: Avoid exception if using multiple rawcopy/no-table entries.
authorKristian Amlie <kristian.amlie@mender.io>
Thu, 9 Mar 2017 14:37:09 +0000 (15:37 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 11 Mar 2017 16:08:49 +0000 (16:08 +0000)
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@mender.io>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/plugins/imager/direct.py

index b7e324aab6e2dc34d392820d471947f7fe5fe9c4..235eb24f594aba86834afd84eedd3083de891d6d 100644 (file)
@@ -547,7 +547,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):