* For consistency with "nix-store -q --hash", produce hashes in
base-32. (This affects Hydra manifests.)
This commit is contained in:
parent
1df120cb05
commit
216440b3ff
|
@ -67,7 +67,7 @@ SV * queryPathHash(char * path)
|
||||||
try {
|
try {
|
||||||
doInit();
|
doInit();
|
||||||
Hash hash = store->queryPathHash(path);
|
Hash hash = store->queryPathHash(path);
|
||||||
string s = "sha256:" + printHash(hash);
|
string s = "sha256:" + printHash32(hash);
|
||||||
XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0)));
|
XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0)));
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
croak(e.what());
|
croak(e.what());
|
||||||
|
|
|
@ -198,8 +198,8 @@ for (my $n = 0; $n < scalar @storePaths; $n++) {
|
||||||
# In some exceptional cases (such as VM tests that use the Nix
|
# In some exceptional cases (such as VM tests that use the Nix
|
||||||
# store of the host), the database doesn't contain the hash. So
|
# store of the host), the database doesn't contain the hash. So
|
||||||
# compute it.
|
# compute it.
|
||||||
if ($narHash eq "sha256:0000000000000000000000000000000000000000000000000000") {
|
if ($narHash =~ /^sha256:0*$/) {
|
||||||
$narHash = `$binDir/nix-hash --type sha256 '$storePath'`;
|
$narHash = `$binDir/nix-hash --type sha256 --base32 '$storePath'`;
|
||||||
die "cannot hash `$storePath'" if $? != 0;
|
die "cannot hash `$storePath'" if $? != 0;
|
||||||
chomp $narHash;
|
chomp $narHash;
|
||||||
$narHash = "sha256:$narHash";
|
$narHash = "sha256:$narHash";
|
||||||
|
|
Loading…
Reference in a new issue