Commit Graph

14 Commits

Author SHA1 Message Date
6861c7d36c tools/classify_carve.py: normalize head case, accept argv, and check resolved report path upfront 2026-11-26 20:25:22 +08:00
8d296d8158 classify_carve: close mkstemp fd on fdopen error and restore mode before unlink 2026-11-24 20:53:08 +08:00
18fc40ce48 Merge PR #9587 2026-11-23 17:08:32 -05:00
bb0ca26c09 fix: accept UTF-8 BOM in carve indexes 2026-11-24 10:30:44 +13:00
fe132ae8b2 classify_carve: catch RecursionError and unreadable root, and preserve symlinked types.json 2026-11-23 22:22:28 +01:00
d90444f21e classify_carve: the usage line names tools/classify_carve.py (EGEN-CLASSIFYCARVE-USAGE) (#6752)
Squash-merged after diff review of PR #6752
2026-11-23 10:47:35 -06:00
77938c99ed classify_carve: make directory error actionable 2026-11-22 14:39:03 -06:00
bfcf319c5d classify_carve: refuse a directory report path 2026-11-22 14:30:37 -06:00
42537d6987 classify_carve, spirv_stubs: -h/--help prints usage instead of being read as a path
Both tools parse sys.argv by hand, so --help was taken as the input folder:
classify_carve reported '--help: does not exist' (exit 2) and spirv_stubs
'missing --help/index.json' (exit 1). -h and --help now print the usage to
stdout and exit 0 without touching the file system. Tests cover both flags
on both tools and fail on the previous code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:22:32 +00:00
82cbfaa2d0 classify_carve: write the size stats the docstring describes
The module docstring has said types.json holds counts and size stats, but
only files and bytes were written. Each per-class entry, overall and per
archive, now also has min, max and median: the smallest, largest and
median (lower middle for an even count) file size in bytes. The existing
keys, their values and the printed summary are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 14:12:42 +07:00
d771bd88e2 classify_carve.py: a missing argument or a bad carve root is one line
main() read sys.argv[1] directly: no argument was an IndexError, a
missing root a FileNotFoundError from os.listdir and a file a
NotADirectoryError, all as tracebacks. A second argument was silently
ignored and the run went ahead. Now a wrong argument count prints the
usage line, and a missing or non-folder root names the path; both exit
2 before types.json is written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:50:48 +01:00
1842b429ce classify_carve.py: report malformed indexes without replacing the census 2026-11-22 01:01:59 +01:00
31925ff0c6 classify_carve.py: preserve reports when a write fails 2026-11-22 00:23:40 +01:00
48613bbda9 Tests: pin classify_carve classes and rpf_probe header reads 2026-11-21 21:01:30 +00:00