mirror of
https://github.com/NixOS/nix.git
synced 2025-11-19 16:59:35 +01:00
Merge pull request #14589 from lovesegfault/fix-fetchers-substitute-test
tests: fix fetchers-substitute test for new narHash JSON format
This commit is contained in:
commit
09d6847490
1 changed files with 3 additions and 1 deletions
|
|
@ -120,7 +120,9 @@
|
|||
path_info_json = substituter.succeed(f"nix path-info --json {tarball_store_path}").strip()
|
||||
path_info_dict = json.loads(path_info_json)
|
||||
# nix path-info returns a dict with store paths as keys
|
||||
tarball_hash_sri = path_info_dict[tarball_store_path]["narHash"]
|
||||
narHash_obj = path_info_dict[tarball_store_path]["narHash"]
|
||||
# Convert from structured format {"algorithm": "sha256", "format": "base64", "hash": "..."} to SRI string
|
||||
tarball_hash_sri = f"{narHash_obj['algorithm']}-{narHash_obj['hash']}"
|
||||
print(f"Tarball NAR hash (SRI): {tarball_hash_sri}")
|
||||
|
||||
# Also get the old format hash for fetchTarball (which uses sha256 parameter)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue