From bc4914bcf114da6eb5da46f6cb1f2be3e0fb917a Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sun, 22 Sep 2024 23:09:44 +0530 Subject: [PATCH] google-chrome: fix update script Chrome uses partial rollout for Darwin and Windows This is represented by `fractionGroup` and `fraction`. 0.25 means 25% of users, 0.5 means 50% of users and so on. Partial rollouts aren't done on linux, and so `fraction` and `fractionalGroup` is always 1 for it. Here we add some additional parameters to chrome version history api endpoint, to get the latest version, sort the versions in descending order. These parameters are redundant on Linux but kept anyway. See https://github.com/NixOS/nixpkgs/pull/343552#issuecomment-2366799267 Docs: https://developer.chrome.com/docs/web-platform/versionhistory/reference#filter --- pkgs/by-name/go/google-chrome/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/go/google-chrome/update.sh b/pkgs/by-name/go/google-chrome/update.sh index 0e63c9bb6090..cf5113eac6a8 100755 --- a/pkgs/by-name/go/google-chrome/update.sh +++ b/pkgs/by-name/go/google-chrome/update.sh @@ -10,7 +10,7 @@ get_version_info() { local start_pattern="$2" local end_pattern="$3" - local url="https://versionhistory.googleapis.com/v1/chrome/platforms/${platform}/channels/stable/versions/all/releases" + local url="https://versionhistory.googleapis.com/v1/chrome/platforms/${platform}/channels/stable/versions/all/releases?filter=endtime=none,fraction>=0.5&order_by=version%20desc" local response local version local current_version