From ac7f6424ed576349d85227afea5cffefc84b8c98 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Fri, 4 Oct 2019 14:51:44 +0800 Subject: [PATCH] Detect differently named Kauai parcels Necessary for newer `tbxi` versions, which append the version and date to parcel names. --- macmini.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/macmini.py b/macmini.py index 112f034..483cf6d 100755 --- a/macmini.py +++ b/macmini.py @@ -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)