From 92864aab8b5c334c571ae1582c2108fee81149ff Mon Sep 17 00:00:00 2001 From: Nemo Date: Thu, 27 Oct 2022 00:10:38 +0530 Subject: [PATCH] [apple] Update Mac regex to support Ventura No dots in the version number was tripping the regex --- src/apple.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/apple.py b/src/apple.py index f2dda992..f929d89b 100644 --- a/src/apple.py +++ b/src/apple.py @@ -19,10 +19,12 @@ URLS = [ ] # If you are changing these, please -# use https://www.toptal.com/developers/hastebin/mikahukube.txt as your corpus +# use https://gist.githubusercontent.com/captn3m0/e7cb1f4fc3c07a5da0296ebda2b33e15/raw/5747e42ad611ec9ffdb7a2d1c0e3946bb87ab6d7/apple.txt as your corpus # to validate your changes CONFIG = { "macos": [ + # This covers major releases with no minor version + r"macOS [\w ]+ (?P\d{2})", # This covers Sierra and beyond r"macOS [\w ]+ (?P\d{2}(?:\.\d+)+)", # This covers Mavericks - El Capitan @@ -31,11 +33,18 @@ CONFIG = { r"^Mac OS X [\w ]+ v?(?P\d{2}(?:\.\d+)+)", ], "ios": [ + r"iOS (?P\d+)", r"iOS (?P\d+(?:)(?:\.\d+)+)", r"iPhone v?(?P\d+(?:)(?:\.\d+)+)", ], - "ipados": [r"iPadOS (?P\d+(?:)(?:\.\d+)+)"], - "watchos": [r"watchOS (?P\d+(?:)(?:\.\d+)+)"], + "ipados": [ + r"iPadOS (?P\d+)", + r"iPadOS (?P\d+(?:)(?:\.\d+)+)" + ], + "watchos": [ + r"watchOS (?P\d+)", + r"watchOS (?P\d+(?:)(?:\.\d+)+)" + ], } release_lists = {k: {} for k in CONFIG.keys()} @@ -62,6 +71,7 @@ for url in URLS: for version in matches: abs_date = None try: + print("== %s" % version_text.strip()) abs_date = parse_date(td_list[2].get_text()) print_date = abs_date.strftime("%Y-%m-%d") # Only update the date if we are adding first time