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

Merge branch 'lock' into 'master'

scanner: support workspace for lock files

See merge request fdroid/fdroidserver!1513
This commit is contained in:
Hans-Christoph Steiner 2024-09-04 14:55:40 +00:00
commit 745f01a96c
12 changed files with 20 additions and 6 deletions

View File

@ -797,6 +797,14 @@ include tests/source-files/firebase-allowlisted/build.gradle
include tests/source-files/firebase-suspect/app/build.gradle
include tests/source-files/firebase-suspect/build.gradle
include tests/source-files/info.guardianproject.ripple/build.gradle
include tests/source-files/lockfile.test/flutter/pubspec.lock
include tests/source-files/lockfile.test/flutter/pubspec.yaml
include tests/source-files/lockfile.test/javascript/package.json
include tests/source-files/lockfile.test/javascript/yarn.lock
include tests/source-files/lockfile.test/rust/subdir2/Cargo.toml
include tests/source-files/lockfile.test/rust/subdir/Cargo.lock
include tests/source-files/lockfile.test/rust/subdir/Cargo.toml
include tests/source-files/lockfile.test/rust/subdir/subdir/subdir/Cargo.toml
include tests/source-files/open-keychain/open-keychain/build.gradle
include tests/source-files/open-keychain/open-keychain/OpenKeychain/build.gradle
include tests/source-files/org.mozilla.rocket/app/build.gradle

View File

@ -53,7 +53,7 @@ MAVEN_URL_REGEX = re.compile(
DEPFILE = {
"Cargo.toml": ["Cargo.lock"],
"pubspec.yaml": ["pubspec.lock"],
"package.json": ["package.lock", "yarn.lock", "pnpm-lock.yaml"],
"package.json": ["package-lock.json", "yarn.lock", "pnpm-lock.yaml"],
}
SCANNER_CACHE_VERSION = 1
@ -816,9 +816,15 @@ def scan_source(build_dir, build=metadata.Build(), json_per_build=None):
)
elif curfile in DEPFILE:
for lockfile in DEPFILE[curfile]:
if os.path.isfile(os.path.join(root, lockfile)):
break
d = root
while d.startswith(build_dir):
for lockfile in DEPFILE[curfile]:
if os.path.isfile(os.path.join(d, lockfile)):
break
else:
d = os.path.dirname(d)
continue
break
else:
count += handleproblem(
_('dependency file without lock'),

View File

@ -54,11 +54,11 @@ class ScannerTest(unittest.TestCase):
'Zillode': 1,
'cn.wildfirechat.chat': 4,
'com.github.shadowsocks': 9,
'com.integreight.onesheeld': 16,
'com.integreight.onesheeld': 17,
'com.jens.automation2': 3,
'firebase-suspect': 1,
'org.mozilla.rocket': 2,
'org.tasks': 2,
'org.tasks': 3,
'realm': 1,
'se.manyver': 3,
'lockfile.test': 1,

View File