From 47f34ea48d5c7a0ebe0b6dc4b42708d8044b80f6 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Thu, 19 Dec 2024 09:26:51 +0100 Subject: [PATCH] build-driver: handle sources before upload_daily Most importantly this deletes grml_sources before uploading to the daily host. Saves us disk space and upload time. --- build-driver/build.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build-driver/build.py b/build-driver/build.py index 40ac4a48..ddc144ac 100755 --- a/build-driver/build.py +++ b/build-driver/build.py @@ -513,6 +513,15 @@ def main(program_name: str, argv: list[str]) -> int: old_iso_path, ) + # Remove the sources *directory*, to not have the sources twice in the CI artifacts. + grml_sources_directory = build_dir / "grml_sources" + if grml_sources_directory.exists(): + print(f"I: Removing {grml_sources_directory}") + shutil.rmtree(grml_sources_directory, ignore_errors=True) + + if old_sources_path: + old_sources_path.rename(build_dir / job_properties.sources_name) + if upload_to_daily: upload_daily(job_properties.job_name, build_dir, job_properties.job_timestamp) @@ -521,15 +530,6 @@ def main(program_name: str, argv: list[str]) -> int: old_dpkg_list_previous_build.parent.mkdir(exist_ok=True) shutil.copyfile(new_dpkg_list, old_dpkg_list_previous_build) - if old_sources_path: - old_sources_path.rename(build_dir / job_properties.sources_name) - - # Remove the sources *directory*, to not have the sources twice in the CI artifacts. - grml_sources_directory = build_dir / "grml_sources" - if grml_sources_directory.exists(): - print(f"I: Removing {grml_sources_directory}") - shutil.rmtree(grml_sources_directory, ignore_errors=True) - print("I: Success.") return 0