0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-11 21:06:19 +03:00

update-python-libraries: don't error out on nix-prefetch-url errors

$ nix-prefetch-url --type sha256 --unpack https://api.github.com/repos/pkgw/pwkit/tarball/pwkit@1.2.0
error: store path 'rb2j54laxa71152bsqayw4h5hni2nshj-pwkit@1.2.0' contains illegal character '@'
This commit is contained in:
Martin Weinelt 2024-06-19 04:47:17 +02:00
parent f4b46cf524
commit 06922865e8

View file

@ -319,14 +319,17 @@ def _get_latest_version_github(attr_path, package, extension, current_version, t
tag_url = str(release["tarball_url"]).replace( tag_url = str(release["tarball_url"]).replace(
"tarball", "tarball/refs/tags" "tarball", "tarball/refs/tags"
) )
hash = ( try:
subprocess.check_output( hash = (
["nix-prefetch-url", "--type", "sha256", "--unpack", tag_url], subprocess.check_output(
stderr=subprocess.DEVNULL, ["nix-prefetch-url", "--type", "sha256", "--unpack", tag_url],
stderr=subprocess.DEVNULL,
)
.decode("utf-8")
.strip()
) )
.decode("utf-8") except subprocess.CalledProcessError:
.strip() raise ValueError("nix-prefetch-url failed")
)
return version, hash, prefix return version, hash, prefix