Skip to content

Commit

Permalink
removes old archives from client cache dir
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaTegner committed Oct 11, 2024
1 parent 8dad64b commit 969aae5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tufup/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ def check_for_updates(
sys.exit()
return None
# check for new target files (archives and patches)
# look through all files in self.current_archive_local_path.parent, and remove all that is not self.current_archive_local_path
# this is to save space
for file in self.current_archive_local_path.parent.iterdir():
if TargetMeta(file) < self.current_archive:
file.unlink()
logger.debug(f'current archive: {self.current_archive.filename}')
all_new_targets = dict(
(target_meta, self.get_targetinfo(target_meta))
Expand Down

0 comments on commit 969aae5

Please sign in to comment.