Compare commits

..

No commits in common. "ba05b740ef32dddd2982cc4ed782d8af84a3beb8" and "520545b6ded38b42c788362871364010da734a96" have entirely different histories.

View File

@ -279,14 +279,16 @@ class Updater:
def _get_version_info(self, tag: str) -> tuple[str | None, str | None]:
if _VERSION_RE.fullmatch(tag):
return tag, None
elif self._exact and tag != 'latest':
return None, None
api_info = self._call_api(tag)
if tag == 'latest':
requested_version = api_info['tag_name']
else:
match = re.search(rf'\s+(?P<version>{_VERSION_RE.pattern})$', api_info.get('name', ''))
requested_version = match.group('version') if match else None
match = _VERSION_RE.search(api_info.get('name', ''))
requested_version = match[0] if match else None
if re.fullmatch(_HASH_PATTERN, api_info.get('target_commitish', '')):
target_commitish = api_info['target_commitish']
@ -374,7 +376,7 @@ class Updater:
elif target_commitish:
has_update = target_commitish != self.current_commit
else:
has_update = False
has_update = True
current_label = _make_label(ORIGIN, CHANNEL.partition("@")[2] or self.current_version, self.current_version)
if not has_update:
@ -443,6 +445,8 @@ class Updater:
return False
self.ydl.to_screen(f'Current Build Hash: {_sha256_file(self.filename)}')
if not update_info.checksum:
self._block_restart('Automatically restarting into unverified builds is disabled for security reasons')
update_label = _make_label(self.requested_repo, update_info.tag, update_info.version)
self.ydl.to_screen(f'Updating to {update_label} ...')