about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/browsers/chromium/update.py
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-10-22 08:39:18 +0000
committerAlyssa Ross <hi@alyssa.is>2023-10-22 08:39:18 +0000
commit403acf82248d3cdbc0beda0c5c373c1b46b9b636 (patch)
treee3913fd47e374b9525858fa1e61064fd1113e475 /nixpkgs/pkgs/applications/networking/browsers/chromium/update.py
parentb5faee77a2dceb31545db209ebee1476acb71198 (diff)
parent8dfad603247387df1df4826b8bea58efc5d012d8 (diff)
downloadnixlib-403acf82248d3cdbc0beda0c5c373c1b46b9b636.tar
nixlib-403acf82248d3cdbc0beda0c5c373c1b46b9b636.tar.gz
nixlib-403acf82248d3cdbc0beda0c5c373c1b46b9b636.tar.bz2
nixlib-403acf82248d3cdbc0beda0c5c373c1b46b9b636.tar.lz
nixlib-403acf82248d3cdbc0beda0c5c373c1b46b9b636.tar.xz
nixlib-403acf82248d3cdbc0beda0c5c373c1b46b9b636.tar.zst
nixlib-403acf82248d3cdbc0beda0c5c373c1b46b9b636.zip
Merge commit '8dfad603247387df1df4826b8bea58efc5d012d8'
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/browsers/chromium/update.py')
-rwxr-xr-xnixpkgs/pkgs/applications/networking/browsers/chromium/update.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/applications/networking/browsers/chromium/update.py b/nixpkgs/pkgs/applications/networking/browsers/chromium/update.py
index fd8f36778405..60267331cc27 100755
--- a/nixpkgs/pkgs/applications/networking/browsers/chromium/update.py
+++ b/nixpkgs/pkgs/applications/networking/browsers/chromium/update.py
@@ -59,9 +59,9 @@ def prefetch_src_sri_hash(attr_path, version):
 
 def nix_prefetch_url(url, algo='sha256'):
     """Prefetches the content of the given URL."""
-    print(f'nix-prefetch-url {url}')
-    out = subprocess.check_output(['nix-prefetch-url', '--type', algo, url])
-    return out.decode('utf-8').rstrip()
+    print(f'nix store prefetch-file {url}')
+    out = subprocess.check_output(['nix', 'store', 'prefetch-file', '--json', '--hash-type', algo, url])
+    return json.loads(out)['hash']
 
 
 def nix_prefetch_git(url, rev):
@@ -96,9 +96,9 @@ def get_chromedriver(channel):
 
         return {
             'version': channel['version'],
-            'sha256_linux': nix_prefetch_url(get_chromedriver_url('linux64')),
-            'sha256_darwin': nix_prefetch_url(get_chromedriver_url('mac-x64')),
-            'sha256_darwin_aarch64': nix_prefetch_url(get_chromedriver_url('mac-arm64'))
+            'hash_linux': nix_prefetch_url(get_chromedriver_url('linux64')),
+            'hash_darwin': nix_prefetch_url(get_chromedriver_url('mac-x64')),
+            'hash_darwin_aarch64': nix_prefetch_url(get_chromedriver_url('mac-arm64'))
         }
 
 
@@ -113,7 +113,7 @@ def get_channel_dependencies(version):
             'version': datetime.fromisoformat(gn['date']).date().isoformat(),
             'url': gn['url'],
             'rev': gn['rev'],
-            'sha256': gn['sha256']
+            'hash': gn['hash']
         }
     }
 
@@ -222,11 +222,11 @@ with urlopen(RELEASES_URL) as resp:
             google_chrome_suffix = channel_name
 
         try:
-            channel['sha256'] = prefetch_src_sri_hash(
+            channel['hash'] = prefetch_src_sri_hash(
                 channel_name_to_attr_name(channel_name),
                 release["version"]
             )
-            channel['sha256bin64'] = nix_prefetch_url(
+            channel['hash_deb_amd64'] = nix_prefetch_url(
                 f'{DEB_URL}/google-chrome-{google_chrome_suffix}/' +
                 f'google-chrome-{google_chrome_suffix}_{release["version"]}-1_amd64.deb')
         except subprocess.CalledProcessError:
@@ -241,7 +241,7 @@ with urlopen(RELEASES_URL) as resp:
             ungoogled_repo_url = 'https://github.com/ungoogled-software/ungoogled-chromium.git'
             channel['deps']['ungoogled-patches'] = {
                 'rev': release['ungoogled_tag'],
-                'sha256': nix_prefetch_git(ungoogled_repo_url, release['ungoogled_tag'])['sha256']
+                'hash': nix_prefetch_git(ungoogled_repo_url, release['ungoogled_tag'])['hash']
             }
             with open(UNGOOGLED_FLAGS_PATH, 'w') as out:
                 out.write(get_ungoogled_chromium_gn_flags(release['ungoogled_tag']))