fix: exit 1 when a hash lookup finds nothing

The documented example looked up a test fixture hash, printed NOT FOUND
and exited 0. The docs now use a hash the database holds and say which
line forms a hash file accepts.
This commit is contained in:
Abdessamad Derraz committed 2026-10-18 07:19:01 +02:00
1 parent 84a144be66
commit d6d03617db
6 files changed
+45 -10

No files matched your search

+4 -2
View File
@@ -3033,9 +3033,11 @@ def _main(held: contextlib.ExitStack) -> None:
sys.exit(1)
db = load_database(args.db)
if not args.platform and not args.emulator:
lookup_hashes(
# A lookup that found nothing is an answer a script must see.
if lookup_hashes(
hashes, db, args.bios_dir, args.emulators_dir, args.platforms_dir
)
):
sys.exit(1)
return
zip_contents = build_zip_contents_index(db)
with _pack_output_lock(args.output_dir):