gildas: fix update script

The hash needs to be converted to SRI format with `nix-hash`.
This commit is contained in:
Sébastien Maret
2025-05-05 01:14:36 +05:30
committed by Masum Reza
parent 8ddddcd3c0
commit cbaab9e818
+7 -4
View File
@@ -85,11 +85,14 @@ def get_hash(srcVersion):
"""
url = f"http://www.iram.fr/~gildas/dist/gildas-src-{srcVersion}.tar.xz"
srcHash = (
subprocess.check_output(["nix-prefetch-url", url, "--unpack"]).decode().strip()
srcHash = subprocess.check_output(["nix-prefetch-url", url]).decode().strip()
# Convert to SRI representation
srcSRIHash = (
subprocess.check_output(["nix-hash", "--to-sri", "--type", "sha256", srcHash])
.decode()
.strip()
)
return f"sha256:{srcHash}"
return srcSRIHash
def get_package_attribute(attr):