From: Kristian Amlie Date: Thu, 9 Mar 2017 14:37:09 +0000 (+0100) Subject: wic/direct.py: Avoid exception if using multiple rawcopy/no-table entries. X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~22133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1a3eac376c4600cdb128d870ad9b7e9d51ed9c0;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git wic/direct.py: Avoid exception if using multiple rawcopy/no-table entries. 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 Signed-off-by: Ross Burton --- diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index b7e324aab6e..235eb24f594 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py @@ -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):