diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2022-10-25 11:38:59 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2022-10-25 15:14:02 +0200 |
commit | 812dd30e629dbc6cf7be240de004ca70799cce87 (patch) | |
tree | a709d5d0055eae5670e13c8a7eb6f5763a8255d8 /pkgs/desktops | |
parent | a9b97f18d003ebca2e0b8a0c04fe14f02e4505be (diff) |
gnome.updateScript: Prevent downgrading packages
Diffstat (limited to 'pkgs/desktops')
-rw-r--r-- | pkgs/desktops/gnome/update.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkgs/desktops/gnome/update.nix b/pkgs/desktops/gnome/update.nix index 9f03be660ae5..ce8ed07a5ae3 100644 --- a/pkgs/desktops/gnome/update.nix +++ b/pkgs/desktops/gnome/update.nix @@ -25,6 +25,7 @@ let import os import subprocess import sys + from libversion import Version _, attr_path, package_name, package_version, version_policy, *remaining_args = sys.argv @@ -51,6 +52,12 @@ let ], encoding="utf-8", ) + + if Version(latest_tag) <= Version(package_version): + # No newer updates found. + print(json.dumps([])) + sys.exit(0) + latest_tag = latest_tag.strip() subprocess.run( [ |