]> glassweightruler.freedombox.rocks Git - waydroid.git/commitdiff
images: Cleanup Waydroid Updater zips after extracting
authorJami Kettunen <jami.kettunen@protonmail.com>
Fri, 27 Jan 2023 12:34:27 +0000 (14:34 +0200)
committerAlessandro Astone <ales.astone@gmail.com>
Fri, 27 Jan 2023 12:38:00 +0000 (13:38 +0100)
These will take up quite a bit of space over time in
~/.local/share/waydroid/data/lineageos_updates/ and should be cleaned up
during the update process.

tools/helpers/images.py

index eb9e2682240c923ab92fe33df2938d7ff8fc6f87..65a7ea5264ce84ce50f1936f273d57210b6921ad 100644 (file)
@@ -87,11 +87,13 @@ def replace(args, system_zip, system_time, vendor_zip, vendor_time):
     if os.path.exists(system_zip):
         with zipfile.ZipFile(system_zip, 'r') as zip_ref:
             zip_ref.extractall(args.images_path)
+        os.remove(system_zip)
         cfg["waydroid"]["system_datetime"] = str(system_time)
         tools.config.save(args, cfg)
     if os.path.exists(vendor_zip):
         with zipfile.ZipFile(vendor_zip, 'r') as zip_ref:
             zip_ref.extractall(args.images_path)
+        os.remove(vendor_zip)
         cfg["waydroid"]["vendor_datetime"] = str(vendor_time)
         tools.config.save(args, cfg)
     remove_overlay(args)