1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-04 16:30:12 +02:00

Merge branch 'copy_scanner' into 'master'

[scanner] Deep copy json structs (Closes: #985)

Closes #985

See merge request fdroid/fdroidserver!1102
This commit is contained in:
Hans-Christoph Steiner 2022-04-21 12:58:35 +00:00
commit 5448327277

View File

@ -23,6 +23,7 @@ import re
import sys
import traceback
from argparse import ArgumentParser
from copy import deepcopy
import logging
import itertools
@ -35,7 +36,7 @@ config = None
options = None
DEFAULT_JSON_PER_BUILD = {'errors': [], 'warnings': [], 'infos': []} # type: ignore
json_per_build = DEFAULT_JSON_PER_BUILD
json_per_build = deepcopy(DEFAULT_JSON_PER_BUILD)
MAVEN_URL_REGEX = re.compile(r"""\smaven\s*{.*?(?:setUrl|url)\s*=?\s*(?:uri)?\(?\s*["']?([^\s"']+)["']?[^}]*}""",
re.DOTALL)
@ -479,7 +480,7 @@ def main():
else:
logging.info(_("{appid}: no builds specified, running on current source state")
.format(appid=appid))
json_per_build = DEFAULT_JSON_PER_BUILD
json_per_build = deepcopy(DEFAULT_JSON_PER_BUILD)
json_per_appid['current-source-state'] = json_per_build
count = scan_source(build_dir)
if count > 0:
@ -489,7 +490,7 @@ def main():
app['Builds'] = []
for build in app.get('Builds', []):
json_per_build = DEFAULT_JSON_PER_BUILD
json_per_build = deepcopy(DEFAULT_JSON_PER_BUILD)
json_per_appid[build.versionCode] = json_per_build
if build.disable and not options.force: