From 95a2ac0fd9938b30273148ae660eba72116727ac Mon Sep 17 00:00:00 2001 From: Rhys Davies Date: Sun, 15 Oct 2023 11:23:55 +1300 Subject: [PATCH] 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. --- .../networking/browsers/microsoft-edge/browser.nix | 4 +++- .../applications/networking/browsers/microsoft-edge/update.py | 2 +- 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 9d3da97fff8c..a73768519086 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 616dc0999505..724a83d09d54 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]):