chromium: update.py: Download files from the main repository

The tag 98.0.4710.4 is missing on the official GitHub mirror. As a
result the download of the DEPS file was failing (HTTP Error 404: Not
Found). Using the upstream repository is obviously better anyway, it's
just less obvious how to fetch a file from there (?format=TEXT).
This commit is contained in:
Michael Weiss 2021-11-20 18:06:30 +01:00
parent 9e06375eb2
commit b054a8594a
No known key found for this signature in database
GPG Key ID: 5BE487C4D4771D83

View File

@ -5,6 +5,7 @@
via upstream-info.json."""
# Usage: ./update.py [--commit]
import base64
import csv
import json
import re
@ -48,9 +49,10 @@ def nix_prefetch_git(url, rev):
def get_file_revision(revision, file_path):
"""Fetches the requested Git revision of the given Chromium file."""
url = f'https://raw.githubusercontent.com/chromium/chromium/{revision}/{file_path}'
url = f'https://chromium.googlesource.com/chromium/src/+/refs/tags/{revision}/{file_path}?format=TEXT'
with urlopen(url) as http_response:
return http_response.read()
resp = http_response.read()
return base64.b64decode(resp)
def get_matching_chromedriver(version):