mirror of
https://github.com/NixOS/nix.git
synced 2025-11-14 22:42:41 +01:00
Fix #14532. As discussed on the call today: 1. We'll stick with `format = "base16"` and `hash = "<hash>"`, not do `base16 = "<hash>"`, in order to be forward compatible with supporting more versioning formats. The motivation we discussed for someday *possibly* doing this is making it easier to write very slap-dash lang2nix tools that create (not consume) derivations with dynamic derivations. 2. We will remove support for non-base16 (and make that the default, not base64) in `Hash`, so this is strictly forward contingency, *not* yet something we support. (And also not something we have concrete plans to start supporting.)
33 lines
867 B
Bash
Executable file
33 lines
867 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
source common.sh
|
|
|
|
echo foo > "$TEST_ROOT"/foo
|
|
foo=$(nix store add-file "$TEST_ROOT"/foo)
|
|
|
|
echo bar > "$TEST_ROOT"/bar
|
|
bar=$(nix store add-file "$TEST_ROOT"/bar)
|
|
|
|
echo baz > "$TEST_ROOT"/baz
|
|
baz=$(nix store add-file "$TEST_ROOT"/baz)
|
|
nix-store --delete "$baz"
|
|
|
|
diff --unified --color=always \
|
|
<(nix path-info --json "$foo" "$bar" "$baz" |
|
|
jq --sort-keys 'map_values(.narHash)') \
|
|
<(jq --sort-keys <<-EOF
|
|
{
|
|
"$foo": {
|
|
"algorithm": "sha256",
|
|
"format": "base16",
|
|
"hash": "42fb4031b525feebe2f8b08e6e6a8e86f34e6a91dd036ada888e311b9cc8e690"
|
|
},
|
|
"$bar": {
|
|
"algorithm": "sha256",
|
|
"format": "base16",
|
|
"hash": "f5f8581aef5fab17100b629cf35aa1d91328d5070b054068f14fa93e7fa3b614"
|
|
},
|
|
"$baz": null
|
|
}
|
|
EOF
|
|
)
|