mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 14:32:28 +03:00
scanner: report all errors
This commit is contained in:
parent
19d709edcd
commit
120a1655b4
2 changed files with 20 additions and 8 deletions
|
@ -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)]
|
paths[p] = [r[len(str(build_dir)) + 1:] for r in glob.glob(full_path)]
|
||||||
if not paths[p]:
|
if not paths[p]:
|
||||||
not_found_paths.append(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:
|
if not_found_paths:
|
||||||
raise FDroidException(
|
raise FDroidException(
|
||||||
"Some glob paths did not match any files/dirs:\n"
|
"Some glob paths did not match any files/dirs:\n"
|
||||||
+ "\n".join(not_found_paths)
|
+ "\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()
|
paths = set()
|
||||||
for k, v in paths_map.items():
|
for k, v in paths_map.items():
|
||||||
for p in v:
|
for p in v:
|
||||||
|
|
|
@ -750,8 +750,12 @@ def scan_source(build_dir, build=metadata.Build(), json_per_build=None):
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
scanignore = common.getpaths_map(build_dir, build.scanignore)
|
scanignore, scanignore_not_found_paths = common.getpaths_map(
|
||||||
scandelete = common.getpaths_map(build_dir, build.scandelete)
|
build_dir, build.scanignore
|
||||||
|
)
|
||||||
|
scandelete, scandelete_not_found_paths = common.getpaths_map(
|
||||||
|
build_dir, build.scandelete
|
||||||
|
)
|
||||||
|
|
||||||
scanignore_worked = set()
|
scanignore_worked = set()
|
||||||
scandelete_worked = set()
|
scandelete_worked = set()
|
||||||
|
@ -1109,11 +1113,19 @@ def scan_source(build_dir, build=metadata.Build(), json_per_build=None):
|
||||||
json_per_build,
|
json_per_build,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for p in scanignore_not_found_paths:
|
||||||
|
logging.error(_("Non-exist scanignore path: %s") % p)
|
||||||
|
count += 1
|
||||||
|
|
||||||
for p in scanignore:
|
for p in scanignore:
|
||||||
if p not in scanignore_worked:
|
if p not in scanignore_worked:
|
||||||
logging.error(_('Unused scanignore path: %s') % p)
|
logging.error(_('Unused scanignore path: %s') % p)
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
|
for p in scandelete_not_found_paths:
|
||||||
|
logging.error(_("Non-exist scandelete path: %s") % p)
|
||||||
|
count += 1
|
||||||
|
|
||||||
for p in scandelete:
|
for p in scandelete:
|
||||||
if p not in scandelete_worked:
|
if p not in scandelete_worked:
|
||||||
logging.error(_('Unused scandelete path: %s') % p)
|
logging.error(_('Unused scandelete path: %s') % p)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue