Detect differently named Kauai parcels

Necessary for newer `tbxi` versions, which append the version and date to parcel
names.
This commit is contained in:
Elliot Nunn 2019-10-04 14:51:44 +08:00
parent 610ec9c8d9
commit ac7f6424ed
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ from os import path
import shutil
import os
import struct
import fnmatch
src, cleanup = patch_common.get_src(desc='''
@ -344,7 +345,7 @@ for (parent, folders, files) in os.walk(src):
open(full, 'w').write(text)
elif filename == 'Parcelfile':
if not path.exists(path.join(parent, 'kauai-ata.pef')):
if not any(fnmatch.fnmatch(fn, 'kauai-ata*.pef') for fn in os.listdir(parent)):
print('ROM lacks Kauai ATA driver (< ROM 9.1), patching it in') # the only known version
shutil.copy(path.join(path.dirname(__file__), 'kauai-ata.pef'), parent)