mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
gnome.updateScript: Prevent downgrading packages
This commit is contained in:
parent
a9b97f18d0
commit
812dd30e62
@ -25,6 +25,7 @@ let
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from libversion import Version
|
||||||
|
|
||||||
_, attr_path, package_name, package_version, version_policy, *remaining_args = sys.argv
|
_, attr_path, package_name, package_version, version_policy, *remaining_args = sys.argv
|
||||||
|
|
||||||
@ -51,6 +52,12 @@ let
|
|||||||
],
|
],
|
||||||
encoding="utf-8",
|
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()
|
latest_tag = latest_tag.strip()
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
[
|
||||||
|
Loading…
Reference in New Issue
Block a user