From 24dc3baadf47ce4cb4302bcbbcc53335f2f33106 Mon Sep 17 00:00:00 2001 From: linsui <2873532-linsui@users.noreply.gitlab.com> Date: Sat, 28 Sep 2024 01:53:04 +0800 Subject: [PATCH] scanner: catalog: relax VERSION_CATALOG_REGEX There may be other blocks in dependencyResolutionManagement --- fdroidserver/scanner.py | 4 +--- tests/source-files/catalog.test/settings.gradle.kts | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fdroidserver/scanner.py b/fdroidserver/scanner.py index aedede9b..0e66a5a4 100644 --- a/fdroidserver/scanner.py +++ b/fdroidserver/scanner.py @@ -73,9 +73,7 @@ GRADLE_KTS_CATALOG_FILE_REGEX = re.compile( GRADLE_CATALOG_FILE_REGEX = re.compile( r'''(\w+)\s*\{[^}]*from\(files\(['"]([^"]+)['"]\)\)''' ) -VERSION_CATALOG_REGEX = re.compile( - r'dependencyResolutionManagement\s*\{[^}]*versionCatalogs\s*\{' -) +VERSION_CATALOG_REGEX = re.compile(r'versionCatalogs\s*\{') class ExitCode(IntEnum): diff --git a/tests/source-files/catalog.test/settings.gradle.kts b/tests/source-files/catalog.test/settings.gradle.kts index 4ea352c8..fd9ba80c 100644 --- a/tests/source-files/catalog.test/settings.gradle.kts +++ b/tests/source-files/catalog.test/settings.gradle.kts @@ -1,4 +1,7 @@ dependencyResolutionManagement { + repositories { + mavenCentral() + } defaultLibrariesExtensionName = "projectLibs" versionCatalogs { create("libs") {