From ddfbd1cc47f58deed4a5b4844f9850e2df5f4d26 Mon Sep 17 00:00:00 2001 From: relan Date: Thu, 21 May 2020 08:50:08 +0300 Subject: [PATCH] build: fix directories removal The 'dirs' array contains a single-level listing of a directory, e. g. ['app', 'build', 'build.gradle', 'gradle', '.gradle']. Multi-component paths like 'build/tmp' could never be found in this array and thus were never removed. Call shutil.rmtree() without checking that the argument is in 'dirs'. If it exists and is a directory, it'll be removed. Otherwise shutil.rmtree() will do nothing. --- fdroidserver/build.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 41467533..df74cdba 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -475,8 +475,7 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext def del_dirs(dl): for d in dl: - if d in dirs: - shutil.rmtree(os.path.join(root, d)) + shutil.rmtree(os.path.join(root, d), ignore_errors=True) def del_files(fl): for f in fl: