Merge pull request 'fix(re-capture): name_block_bases reads the disc from $SYLPHEED_DISC, loudly' (#44) from fix/name-block-bases-disc into main
Reviewed-on: #44
This commit was merged in pull request #44.
This commit is contained in:
@@ -194,7 +194,19 @@ def main():
|
||||
from unit_substructures import pak_entries
|
||||
import unitgroup as _U
|
||||
disc = set()
|
||||
for pk in sorted(glob.glob('/work/sylph_extract/**/*.pak', recursive=True)):
|
||||
# 🔴 This globbed `/work/sylph_extract/**/*.pak`, a path that exists nowhere
|
||||
# since `/work` became a clone. The glob matched nothing, so this section
|
||||
# reported `0` disc names and an empty table WITHOUT an error — while the
|
||||
# committed artefact, generated back when the path existed, shows 13 450.
|
||||
# The disc is required for this section, so a missing disc is an error.
|
||||
disc_root = os.environ.get('SYLPHEED_DISC')
|
||||
if not disc_root or not os.path.isdir(os.path.join(disc_root, 'dat')):
|
||||
sys.exit('this report needs the disc: set $SYLPHEED_DISC to an extracted '
|
||||
'disc root (the directory holding dat/)')
|
||||
paks = sorted(glob.glob(os.path.join(disc_root, '**', '*.pak'), recursive=True))
|
||||
if not paks:
|
||||
sys.exit(f'no .pak files under $SYLPHEED_DISC={disc_root}')
|
||||
for pk in paks:
|
||||
for _h, b in pak_entries(pk):
|
||||
if b[:4] != b'IDXD':
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user