diff options
author | Michael Weiss <dev.primeos@gmail.com> | 2020-11-27 12:38:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-27 12:38:07 +0100 |
commit | 6aea53c3ce3b20c12cbcb61c6f15a744592f3e10 (patch) | |
tree | 1da0d99cd6671b32cba0cd7e7f160e41b1d3f87d /pkgs/applications/networking/browsers/chromium/update.py | |
parent | 33b99efb96d4df3bfdc680e9b5a6d13bcbb2a91a (diff) |
chromedriver: Switch to Chromium's upstream-info.json (#105054)
This enables automatic updates and fixes #85629.
Diffstat (limited to 'pkgs/applications/networking/browsers/chromium/update.py')
-rwxr-xr-x | pkgs/applications/networking/browsers/chromium/update.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/update.py b/pkgs/applications/networking/browsers/chromium/update.py index b404ca555bff..9e1f0aec598d 100755 --- a/pkgs/applications/networking/browsers/chromium/update.py +++ b/pkgs/applications/networking/browsers/chromium/update.py @@ -38,6 +38,20 @@ def get_file_revision(revision, file_path): with urlopen(url) as http_response: return http_response.read() +def get_matching_chromedriver(version): + # See https://chromedriver.chromium.org/downloads/version-selection + build = re.sub('.[0-9]+$', '', version) + chromedriver_version_url = f'https://chromedriver.storage.googleapis.com/LATEST_RELEASE_{build}' + with urlopen(chromedriver_version_url) as http_response: + chromedriver_version = http_response.read().decode() + def get_chromedriver_url(system): + return f'https://chromedriver.storage.googleapis.com/{chromedriver_version}/chromedriver_{system}.zip' + return { + 'version': chromedriver_version, + 'sha256_linux': nix_prefetch_url(get_chromedriver_url('linux64')), + 'sha256_darwin': nix_prefetch_url(get_chromedriver_url('mac64')) + } + def get_channel_dependencies(channel): deps = get_file_revision(channel['version'], 'DEPS') gn_pattern = b"'gn_version': 'git_revision:([0-9a-f]{40})'" @@ -85,6 +99,8 @@ with urlopen(HISTORY_URL) as resp: continue channel['deps'] = get_channel_dependencies(channel) + if channel_name == 'stable': + channel['chromedriver'] = get_matching_chromedriver(channel['version']) channels[channel_name] = channel |