From 120a1655b429100e4c0bc4560cbdda5486833af3 Mon Sep 17 00:00:00 2001 From: linsui <2873532-linsui@users.noreply.gitlab.com> Date: Sat, 26 Jul 2025 18:33:57 +0800 Subject: [PATCH] scanner: report all errors --- fdroidserver/common.py | 12 ++++++------ fdroidserver/scanner.py | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 7d591ab8..ad4df2ba 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -2733,17 +2733,17 @@ def getpaths_map(build_dir, globpaths): paths[p] = [r[len(str(build_dir)) + 1:] for r in glob.glob(full_path)] if not paths[p]: not_found_paths.append(p) + return paths, not_found_paths + + +def getpaths(build_dir, globpaths): + """Extend via globbing the paths from a field and return them as a set.""" + paths_map, not_found_paths = getpaths_map(build_dir, globpaths) if not_found_paths: raise FDroidException( "Some glob paths did not match any files/dirs:\n" + "\n".join(not_found_paths) ) - return paths - - -def getpaths(build_dir, globpaths): - """Extend via globbing the paths from a field and return them as a set.""" - paths_map = getpaths_map(build_dir, globpaths) paths = set() for k, v in paths_map.items(): for p in v: diff --git a/fdroidserver/scanner.py b/fdroidserver/scanner.py index a81912fc..37d3f896 100644 --- a/fdroidserver/scanner.py +++ b/fdroidserver/scanner.py @@ -750,8 +750,12 @@ def scan_source(build_dir, build=metadata.Build(), json_per_build=None): ] ] - scanignore = common.getpaths_map(build_dir, build.scanignore) - scandelete = common.getpaths_map(build_dir, build.scandelete) + scanignore, scanignore_not_found_paths = common.getpaths_map( + build_dir, build.scanignore + ) + scandelete, scandelete_not_found_paths = common.getpaths_map( + build_dir, build.scandelete + ) scanignore_worked = set() scandelete_worked = set() @@ -1109,11 +1113,19 @@ def scan_source(build_dir, build=metadata.Build(), json_per_build=None): json_per_build, ) + for p in scanignore_not_found_paths: + logging.error(_("Non-exist scanignore path: %s") % p) + count += 1 + for p in scanignore: if p not in scanignore_worked: logging.error(_('Unused scanignore path: %s') % p) count += 1 + for p in scandelete_not_found_paths: + logging.error(_("Non-exist scandelete path: %s") % p) + count += 1 + for p in scandelete: if p not in scandelete_worked: logging.error(_('Unused scandelete path: %s') % p)