mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:55:52 +01:00
[PR #25] [MERGED] OLD-7845: hashdict --archives ignores spaces and refuses unknown archive names #79
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#79
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/25
Author: @ItsMrDubey
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism
Base:
main← Head:hashdict-archives-names📝 Commits (2)
1512173hashdict: --archives ignores spaces and refuses an archive the carve does not haveb2e4095tests: the hashdict archive-selection fixture tells a full harvest from metadata-only📊 Changes
2 files changed (+59 additions, -2 deletions)
View changed files
📝
tests/test_hashdict.py(+46 -0)📝
tools/hashdict.py(+13 -2)📄 Description
Claimed in the coordination issue as: OLD-7845 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7119646964)
What and why
Fixes old #7845:
full = set(a.archives.split(","))kept the spaces and never checked the names, so--archives "common, data"selected onlycommon(" data" matched nothing) and a typo such as--archives comonharvested no archive fully, both with exit 0 and no message.Now each entry is stripped and empty entries are dropped. When
--archivesis given explicitly, a name that matches none of the archives in the carve (subfolders with anindex.json, or the one archive when<carve dir>is itself an archive folder) is a usage error viaap.error(exit 2, usage line, like the tool's other usage errors), naming the unknown archive(s) and the archives that are there. It is checked before any harvesting, so an existing--outis left untouched.The default list is not checked: it names five archives and a partial carve (or a one-archive folder such as
<work>/carve/common) legitimately lacks most of them, so refusing them would break the documented default invocation. To tell the two apart,--archivesnow defaults toNoneand the default list lives inDEFAULT_ARCHIVES(shown in--help). An explicit--archives ""still means "no archive fully, PSIN/RBF0 blobs only" and is not an error.Tested
Windows 11, Python 3.11.9, no GPU needed.
commonanddata:--archives "common, data"-> exit 0, only thecommonname in the dictionary;--archives comon-> exit 0, empty dictionary.--archives "common, dta"-> exit 2,hashdict.py: error: --archives: dta not found in <carve> (archives there: common).python -I tests/test_hashdict.py-> Ran 42 tests, OK (the newtest_archives_list_ignores_spaces_and_empty_entriesandtest_archive_named_but_not_carved_is_a_usage_errorfail on origin/main;test_default_archives_absent_from_a_partial_carve_are_not_an_errorpins the default-list behaviour).python -I tests/test_audio_config.py(imports hashdict) -> Ran 22 tests, OK.python -I scripts/check_no_game_data.py tools/hashdict.py tests/test_hashdict.py-> exit 0.AI-assisted: yes
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.