From b054a8594a1f5136e4ae7aa5f4e76bea95d7aab9 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 20 Nov 2021 18:06:30 +0100 Subject: [PATCH] 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). --- pkgs/applications/networking/browsers/chromium/update.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/update.py b/pkgs/applications/networking/browsers/chromium/update.py index 72d6df055b38..f13bda6f5075 100755 --- a/pkgs/applications/networking/browsers/chromium/update.py +++ b/pkgs/applications/networking/browsers/chromium/update.py @@ -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):