Skip to content

Commit

Permalink
Added logic to check for packages with darwin_any or noarch before gi…
Browse files Browse the repository at this point in the history
…ving up
  • Loading branch information
faha223 committed Feb 26, 2024
1 parent 2157fdb commit 859eecb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/download-macos-libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,18 @@ def get_latest_pkg_filename_url(self, pkg_name):
print(' [*] [DEBUG] url opened')
pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.' + self._arch + r'\.tbz2', pkg_list)
print(f' [*] [DEBUG] len(pkgs) {len(pkgs)}')

if len(pkgs) < 1:
pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + r'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\.\-\_\+]*?\.' + r'darwin_any\.noarch\.tbz2', pkg_list)

if len(pkgs) < 1:
print(f' [*] [ERROR] package {pkg_name} not found for arch {self._darwin_target}.{self._arch}')
print(f' [*] [ERROR] package {pkg_name} not found for arch {self._darwin_target}.{self._arch} or darwin_any.noarch')
print(f' [*] [DEBUG] pkg_list: {pkg_list}')
pkg_filename = pkgs[-1]
print(' [*] [DEBUG] returning pkg_filename, pkg_url')
Expand Down

0 comments on commit 859eecb

Please sign in to comment.