From b279d57c09f26090bda32db322d510198d742afe Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 15 Jul 2024 01:30:57 -0700 Subject: [PATCH] download-macos-libs.py: Simplify package pattern match --- scripts/download-macos-libs.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 239c7ae3e6..dd1f913dd6 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -43,15 +43,7 @@ class LibInstaller: def get_latest_pkg_filename_url(self, pkg_name): pkg_base_url = f'{MIRROR}/{pkg_name}' pkg_list = urlopen(pkg_base_url).read().decode('utf-8') - pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.' + self._arch + r'\.tbz2', pkg_list) - - if len(pkgs) < 1: - pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.darwin_any\.' + self._arch + r'\.tbz2', pkg_list) - if len(pkgs) < 1: - pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.noarch\.tbz2', pkg_list) - if len(pkgs) < 1: - pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.darwin_any\.noarch\.tbz2', pkg_list) - + pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.(?:any_any|darwin_any|' + self._darwin_target + r')\.(?:noarch|' + self._arch + r')\.tbz2', pkg_list) if len(pkgs) < 1: print(f' [*] [ERROR] Unable to find version of {pkg_name} compatible with {self._darwin_target}.{self._arch}') exit(1)