1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-19 21:30:10 +01:00

scanner: fix maven url check for kts files

This commit is contained in:
linsui 2022-08-07 17:55:39 +08:00 committed by Hans-Christoph Steiner
parent 07713af425
commit f99dbec012
3 changed files with 4 additions and 1 deletions

View File

@ -44,7 +44,7 @@ options = None
DEFAULT_JSON_PER_BUILD = {'errors': [], 'warnings': [], 'infos': []} # type: ignore DEFAULT_JSON_PER_BUILD = {'errors': [], 'warnings': [], 'infos': []} # type: ignore
json_per_build = deepcopy(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"']+)["']?[^}]*}""", MAVEN_URL_REGEX = re.compile(r"""\smaven\s*(?:{.*?(?:setUrl|url)|\((?:url)?)\s*=?\s*(?:uri)?\(?\s*["']?([^\s"']+)["']?[^})]*[)}]""",
re.DOTALL) re.DOTALL)
CODE_SIGNATURES = { CODE_SIGNATURES = {

View File

@ -776,3 +776,5 @@
- ' maven{ url ''https://maven.aliyun.com/repository/public''}' - ' maven{ url ''https://maven.aliyun.com/repository/public''}'
- ' maven{url "https://jitpack.io"}' - ' maven{url "https://jitpack.io"}'
- ' maven{url "https://plugins.gradle.org/m2/"}' - ' maven{url "https://plugins.gradle.org/m2/"}'
- ' maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")'
- ' maven(url = "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")'

View File

@ -54,6 +54,7 @@ class ScannerTest(unittest.TestCase):
'se.manyver': 2, 'se.manyver': 2,
'com.jens.automation2': 2, 'com.jens.automation2': 2,
'com.github.shadowsocks': 6, 'com.github.shadowsocks': 6,
'org.tasks': 1,
} }
for d in glob.glob(os.path.join(source_files, '*')): for d in glob.glob(os.path.join(source_files, '*')):
build = fdroidserver.metadata.Build() build = fdroidserver.metadata.Build()