src/libstore/build.cc: clarify error message for hash mismatches

Nix reports a hash mismatch saying:

  output path ‘foo’ should have sha256 hash ‘abc’, instead has ‘xyz’

That message is slightly ambiguous and some people read that statement
to mean the exact opposite of what it is supposed to mean. After this
patch, the message will be:

  Nix expects output path ‘foo’ to have sha256 hash ‘abc’, instead it has ‘xyz’
This commit is contained in:
Peter Simons 2015-11-18 18:17:02 +01:00
parent 9ee15abe30
commit 6ad10591ce

View file

@ -2708,7 +2708,7 @@ void DerivationGoal::registerOutputs()
Hash h2 = recursive ? hashPath(ht, actualPath).first : hashFile(ht, actualPath);
if (h != h2)
throw BuildError(
format("output path %1% should have %2% hash %3%, instead has %4%")
format("Nix expects output path %1% to have %2% hash %3%, instead it has %4%")
% path % i.second.hashAlgo % printHash16or32(h) % printHash16or32(h2));
}