about summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers/microsoft-edge
diff options
context:
space:
mode:
authorRhys Davies <rhys@memes.nz>2023-10-15 11:23:55 +1300
committerRhys Davies <rhys@memes.nz>2024-02-06 10:29:52 +1300
commit95a2ac0fd9938b30273148ae660eba72116727ac (patch)
tree5d2b9fc43c5d9bd7568b0a444690fc4dbfd6bfab /pkgs/applications/networking/browsers/microsoft-edge
parent939e432e4650d94bd5a179cad13f2ebcf7fc3c57 (diff)
microsoft-edge: Change update script to have consistent ordering of versions
The current behaviour means it follows the order they are published in microsofts repos which sometimes changes on updates.
This changes it to sort by the branch name string which should be more consistent.

This patch doesn't change the ordering in default.nix will leave that for the next update patch to make that patch more easily backportable.
Diffstat (limited to 'pkgs/applications/networking/browsers/microsoft-edge')
-rw-r--r--pkgs/applications/networking/browsers/microsoft-edge/browser.nix4
-rwxr-xr-xpkgs/applications/networking/browsers/microsoft-edge/update.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/applications/networking/browsers/microsoft-edge/browser.nix b/pkgs/applications/networking/browsers/microsoft-edge/browser.nix
index 9d3da97fff8ce..a737685190863 100644
--- a/pkgs/applications/networking/browsers/microsoft-edge/browser.nix
+++ b/pkgs/applications/networking/browsers/microsoft-edge/browser.nix
@@ -180,7 +180,9 @@ stdenv.mkDerivation rec {
       --add-flags ${lib.escapeShellArg commandLineArgs}
   '';
 
-  passthru.updateScript = ./update.py;
+  # We only want automatic updates for stable, beta and dev will get updated by the same script
+  # and are only used for testing.
+  passthru = lib.optionalAttrs (channel == "stable") { updateScript = ./update.py; };
 
   meta = with lib; {
     homepage = "https://www.microsoft.com/en-us/edge";
diff --git a/pkgs/applications/networking/browsers/microsoft-edge/update.py b/pkgs/applications/networking/browsers/microsoft-edge/update.py
index 616dc09995051..724a83d09d543 100755
--- a/pkgs/applications/networking/browsers/microsoft-edge/update.py
+++ b/pkgs/applications/networking/browsers/microsoft-edge/update.py
@@ -31,7 +31,7 @@ def latest_packages(packages: bytes):
             old_package = latest_packages[channel]
             if old_package.get_version() < package.get_version():  # type: ignore
                 latest_packages[channel] = package
-    return latest_packages
+    return OrderedDict(sorted(latest_packages.items(), key=lambda x:x[0]))
 
 
 def nix_expressions(latest: dict[str, Packages]):