diff options
author | MrOctopus <shock.game@hotmail.com> | 2022-11-11 02:49:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-11 07:19:24 +0530 |
commit | 17fc3dc48af968e28c23197ed06542fdb47aba2b (patch) | |
tree | f0cf3623f21ce704c3eb5e894a70b518cbc31e31 /yt_dlp/update.py | |
parent | 3f5c216969165c4a0583a4795e4d15325dc009d4 (diff) | |
download | hypervideo-pre-17fc3dc48af968e28c23197ed06542fdb47aba2b.tar.lz hypervideo-pre-17fc3dc48af968e28c23197ed06542fdb47aba2b.tar.xz hypervideo-pre-17fc3dc48af968e28c23197ed06542fdb47aba2b.zip |
[build] Create armv7l and aarch64 releases (#5449)
Closes #5436
Authored by: MrOctopus, pukkandan
Diffstat (limited to 'yt_dlp/update.py')
-rw-r--r-- | yt_dlp/update.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/yt_dlp/update.py b/yt_dlp/update.py index 70a1d6f7f..6208aad8a 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -15,6 +15,7 @@ from .utils import ( Popen, cached_method, deprecation_warning, + remove_end, shell_quote, system_identifier, traverse_obj, @@ -35,9 +36,14 @@ def _get_variant_and_executable_path(): return 'py2exe', path if sys._MEIPASS == os.path.dirname(path): return f'{sys.platform}_dir', path - if sys.platform == 'darwin' and version_tuple(platform.mac_ver()[0]) < (10, 15): - return 'darwin_legacy_exe', path - return f'{sys.platform}_exe', path + if sys.platform == 'darwin': + machine = '_legacy' if version_tuple(platform.mac_ver()[0]) < (10, 15) else '' + else: + machine = f'_{platform.machine().lower()}' + # Ref: https://en.wikipedia.org/wiki/Uname#Examples + if machine[1:] in ('x86', 'x86_64', 'amd64', 'i386', 'i686'): + machine = '_x86' if platform.architecture()[0][:2] == '32' else '' + return f'{remove_end(sys.platform, "32")}{machine}_exe', path path = os.path.dirname(__file__) if isinstance(__loader__, zipimporter): @@ -68,10 +74,13 @@ def current_git_head(): _FILE_SUFFIXES = { 'zip': '', 'py2exe': '_min.exe', - 'win32_exe': '.exe', + 'win_exe': '.exe', + 'win_x86_exe': '_x86.exe', 'darwin_exe': '_macos', 'darwin_legacy_exe': '_macos_legacy', 'linux_exe': '_linux', + 'linux_aarch64_exe': '_linux_aarch64', + 'linux_armv7l_exe': '_linux_armv7l', } _NON_UPDATEABLE_REASONS = { @@ -161,10 +170,7 @@ class Updater: @functools.cached_property def release_name(self): """The release filename""" - label = _FILE_SUFFIXES[detect_variant()] - if label and platform.architecture()[0][:2] == '32': - label = f'_x86{label}' - return f'yt-dlp{label}' + return f'yt-dlp{_FILE_SUFFIXES[detect_variant()]}' @functools.cached_property def release_hash(self): |