diff --git a/fdroidserver/scanner.py b/fdroidserver/scanner.py index d212d811..573df30d 100644 --- a/fdroidserver/scanner.py +++ b/fdroidserver/scanner.py @@ -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'), diff --git a/tests/source-files/lockfile.test/pubspec.yaml b/tests/source-files/lockfile.test/flutter/.dart_tool/flutter_gen/pubspec.yaml similarity index 100% rename from tests/source-files/lockfile.test/pubspec.yaml rename to tests/source-files/lockfile.test/flutter/.dart_tool/flutter_gen/pubspec.yaml diff --git a/tests/source-files/lockfile.test/Cargo.lock b/tests/source-files/lockfile.test/flutter/pubspec.lock similarity index 100% rename from tests/source-files/lockfile.test/Cargo.lock rename to tests/source-files/lockfile.test/flutter/pubspec.lock diff --git a/tests/source-files/lockfile.test/Cargo.toml b/tests/source-files/lockfile.test/flutter/pubspec.yaml similarity index 100% rename from tests/source-files/lockfile.test/Cargo.toml rename to tests/source-files/lockfile.test/flutter/pubspec.yaml diff --git a/tests/source-files/lockfile.test/package.json b/tests/source-files/lockfile.test/javascript/package.json similarity index 100% rename from tests/source-files/lockfile.test/package.json rename to tests/source-files/lockfile.test/javascript/package.json diff --git a/tests/source-files/lockfile.test/yarn.lock b/tests/source-files/lockfile.test/javascript/yarn.lock similarity index 100% rename from tests/source-files/lockfile.test/yarn.lock rename to tests/source-files/lockfile.test/javascript/yarn.lock diff --git a/tests/source-files/lockfile.test/rust/subdir/Cargo.lock b/tests/source-files/lockfile.test/rust/subdir/Cargo.lock new file mode 100644 index 00000000..e69de29b diff --git a/tests/source-files/lockfile.test/rust/subdir/Cargo.toml b/tests/source-files/lockfile.test/rust/subdir/Cargo.toml new file mode 100644 index 00000000..e69de29b diff --git a/tests/source-files/lockfile.test/rust/subdir/subdir/subdir/Cargo.toml b/tests/source-files/lockfile.test/rust/subdir/subdir/subdir/Cargo.toml new file mode 100644 index 00000000..e69de29b diff --git a/tests/source-files/lockfile.test/rust/subdir2/Cargo.toml b/tests/source-files/lockfile.test/rust/subdir2/Cargo.toml new file mode 100644 index 00000000..e69de29b