From d6332954f94dfe9555aa8924daebe591f198aff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Mon, 23 Dec 2024 18:02:02 +0100 Subject: [PATCH] fix: fetching latest version when using tag --- nix_update/update.py | 3 ++- nix_update/version/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nix_update/update.py b/nix_update/update.py index c4445cb..c0894a2 100644 --- a/nix_update/update.py +++ b/nix_update/update.py @@ -435,12 +435,13 @@ def update_version( else: assert version.startswith("branch=") branch = version[7:] + old_rev_tag = package.rev or package.tag new_version = fetch_latest_version( package.parsed_url, preference, version_regex, branch, - package.rev, + old_rev_tag, version_prefix, ) package.new_version = new_version diff --git a/nix_update/version/__init__.py b/nix_update/version/__init__.py index 11dcb71..9e94458 100644 --- a/nix_update/version/__init__.py +++ b/nix_update/version/__init__.py @@ -81,7 +81,7 @@ def fetch_latest_version( preference: VersionPreference, version_regex: str, branch: str | None = None, - old_rev: str | None = None, + old_rev_tag: str | None = None, version_prefix: str = "", ) -> Version: unstable: list[str] = [] @@ -119,7 +119,7 @@ def fetch_latest_version( None, ) - if ver is not None and ver.rev != old_rev: + if ver is not None and ver.rev != old_rev_tag: return ver return final[0]