From 36da47b0b5ae0f6c4d963fbffab22930d9f0eb35 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Mon, 1 Jan 2024 10:02:15 +0100 Subject: [PATCH] Fixing cleanup. --- loaih/script.py | 18 ++++++++++++------ setup.py | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/loaih/script.py b/loaih/script.py index 3a64922..4028566 100644 --- a/loaih/script.py +++ b/loaih/script.py @@ -98,12 +98,6 @@ def batch(yamlfile, verbose): # Generic run for the query generic = loaih.Solver.parse(cbuild['query']) - # In case prerelease or daily branches are used, cleanup the download - # folder before first run (to make sure the contents are effectively - # fresh). - if generic.branch in {'prerelease', 'daily'}: - generic.cleanup_downloads(gvars['download_path'], verbose) - for obj in collection: # Configuration phase obj.verbose = verbose @@ -131,6 +125,18 @@ def batch(yamlfile, verbose): obj.generalize_and_link() del obj + # In case prerelease or daily branches are used, cleanup the download + # folder after finishing the complete run (to make sure the next run + # will redownload all the needed files and is indeed fresh). + # we will swipe all the builds inside a collection to understand the files + # to delete. + for cbuild in config['builds']: + # Loop a run for each build. + for build in loaih.build.Collection(cbuild['query']): + + if build.version.branch in {'prerelease', 'daily'}: + build.version.cleanup_downloads(gvars['download_path'], verbose) + @cli.command() @click.option('-a', '--arch', 'arch', default='x86_64', diff --git a/setup.py b/setup.py index e6a9c2c..78384ef 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ long_description = (this_directory / "README.md").read_text() setup( name="loaih", - version="1.3.2", + version="1.3.3", description="LOAIH - LibreOffice AppImage Helpers, help build a LibreOffice AppImage", long_description=long_description, long_description_content_type='text/markdown',