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

+7 -2
View File
@@ -9,10 +9,15 @@ Fine-grained control over pack generation, hardware filtering, truth analysis, a
Look up a single MD5 in the database:
```bash
python scripts/generate_pack.py --from-md5 d8f1206299c48946e6ec5ef96d014eaa
python scripts/generate_pack.py --from-md5 490f666e1afb15b7362b406ed1cea246
```
Build a pack containing only files matching hashes from a list (one MD5 per line, `#` for comments):
It prints the file's name, hashes, path and whether the collection holds it,
and exits 1 when a hash is not in the database, so a script can tell.
Build a pack containing only files matching hashes from a list. Each line
carries one hash (MD5, SHA-1 or CRC32), alone or beside a file name as
`md5sum` writes it; `#` starts a comment:
```bash
python scripts/generate_pack.py --platform batocera --from-md5-file missing.txt
+4 -2
View File
@@ -136,7 +136,7 @@ python scripts/generate_pack.py --platform retroarch --split
python scripts/generate_pack.py --platform retroarch --split --group-by manufacturer
# Hash-based lookup and custom packs
python scripts/generate_pack.py --from-md5 d8f1206299c48946e6ec5ef96d014eaa
python scripts/generate_pack.py --from-md5 490f666e1afb15b7362b406ed1cea246
python scripts/generate_pack.py --platform batocera --from-md5-file missing.txt
python scripts/generate_pack.py --platform retroarch --list-systems
@@ -190,7 +190,9 @@ would have loaded.
- `--split`: generate one ZIP per system instead of one big pack
- `--split --group-by manufacturer`: group split packs by manufacturer (Sony, Nintendo, Sega...)
- `--from-md5`: look up a hash in the database, or build a custom pack with `--platform`/`--emulator`
- `--from-md5-file`: same, reading hashes from a file (one per line, comments with #)
- `--from-md5-file`: same, reading hashes from a file: one MD5, SHA-1 or CRC32
per line, alone or beside a file name as `md5sum` writes it, `#` for comments.
A lookup exits 1 when a hash is not in the database
- `--target`: filter by hardware target (e.g. `switch`, `rpi4`, `x86_64`)
- `--region`: ordered priority list, best first. Regions nest, a system with no
regional split keeps everything, and a group with no candidate in any named