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.
This commit is contained in:
Rhys Davies 2023-10-15 11:23:55 +13:00
parent 939e432e46
commit 95a2ac0fd9
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View file

@ -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";

View file

@ -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]):