Unverified Commit bc4914bc authored by John Titor's avatar John Titor
Browse files

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
parent c57e54a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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