From 631703b543f2560dfd1b18ed6725f67d49a8c71c Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Tue, 3 Dec 2024 22:18:55 -0600 Subject: [PATCH] Finish what I started with non-/tmp for lintian-ppa --- build-packages | 2 +- lintian-ppa | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build-packages b/build-packages index 9737fba..e8e58bb 100755 --- a/build-packages +++ b/build-packages @@ -30,7 +30,7 @@ SUPPRESSED_LINTIAN_TAGS = [ ] BASE_OUTPUT_DIR = "/srv/lubuntu-ci/output" LOG_DIR = os.path.join(BASE_OUTPUT_DIR, "logs", "source_builds") -BASE_LINTIAN_DIR = os.path.join(BASE_OUTPUT_DIR, f"lintian.tmp.{str(uuid.uuid4())[:8]}") +BASE_LINTIAN_DIR = os.path.join(BASE_OUTPUT_DIR, f".lintian.tmp.{str(uuid.uuid4())[:8]}") REAL_LINTIAN_DIR = os.path.join(BASE_OUTPUT_DIR, "lintian") os.makedirs(LOG_DIR, exist_ok=True) diff --git a/lintian-ppa b/lintian-ppa index a84cc5f..be85c2e 100755 --- a/lintian-ppa +++ b/lintian-ppa @@ -89,7 +89,8 @@ def rsync(source, destination): shutil.copy2(src_path, dst_path) def process_sources(url): - tmpdir = os. + tmpdir = os.path.join(BASE_OUTPUT_DIR, f".lintian.tmp.{str(uuid.uuid4())[:8]}") + os.mkdir(tmpdir) changes_file = url.split("/")[-1] logging.info(f"Downloading {changes_file} and friends via dget") dget_command = ["dget", "-u", url] @@ -125,6 +126,8 @@ def process_sources(url): with open(os.path.join(output_path, f"{arch}.txt"), "w") as f: f.write(lintian_output) + shutil.rmtree(tmpdir) + with ThreadPoolExecutor(max_workers=30) as executor: futures = set()