1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-05 18:50:09 +02:00

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.
This commit is contained in:
relan 2020-05-21 08:50:08 +03:00 committed by Hans-Christoph Steiner
parent 68c072c72e
commit ddfbd1cc47

View File

@ -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: