mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-20 13:50:12 +01:00
fix crash when scanner wants to remove the same file more than once
A file can be flagged for multiple problems (i.e. multiple unknown maven repos in one build.gradle file that is included in a scandelete path). The scanner will try to delete it once for every problem detected, we don't really care, as long as the file is gone. fixes fdroid/fdroidserver#759
This commit is contained in:
parent
61736f3f50
commit
03e723b1af
@ -188,7 +188,13 @@ def scan_source(build_dir, build=metadata.Build()):
|
||||
logging.info(msg)
|
||||
if json_per_build is not None:
|
||||
json_per_build['infos'].append([msg, path_in_build_dir])
|
||||
os.remove(filepath)
|
||||
try:
|
||||
os.remove(filepath)
|
||||
except FileNotFoundError:
|
||||
# File is already gone, nothing to do.
|
||||
# This can happen if we find multiple problems in one file that is setup for scandelete
|
||||
# I.e. build.gradle files containig multiple unknown maven repos.
|
||||
pass
|
||||
return 0
|
||||
|
||||
def warnproblem(what, path_in_build_dir):
|
||||
|
Loading…
Reference in New Issue
Block a user