mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 00:06:16 +02:00
* Don't complain if the stored hash of a path is zero (unknown).
This commit is contained in:
parent
f58f51f380
commit
034f608e00
1 changed files with 3 additions and 2 deletions
|
@ -1022,10 +1022,11 @@ void LocalStore::exportPath(const Path & path, bool sign,
|
||||||
dumpPath(path, hashAndWriteSink);
|
dumpPath(path, hashAndWriteSink);
|
||||||
|
|
||||||
/* Refuse to export paths that have changed. This prevents
|
/* Refuse to export paths that have changed. This prevents
|
||||||
filesystem corruption from spreading to other machines. */
|
filesystem corruption from spreading to other machines.
|
||||||
|
Don't complain if the stored hash is zero (unknown). */
|
||||||
Hash hash = hashAndWriteSink.currentHash();
|
Hash hash = hashAndWriteSink.currentHash();
|
||||||
Hash storedHash = queryPathHash(path);
|
Hash storedHash = queryPathHash(path);
|
||||||
if (hash != storedHash)
|
if (hash != storedHash && storedHash != Hash(storedHash.type))
|
||||||
throw Error(format("hash of path `%1%' has changed from `%2%' to `%3%'!") % path
|
throw Error(format("hash of path `%1%' has changed from `%2%' to `%3%'!") % path
|
||||||
% printHash(storedHash) % printHash(hash));
|
% printHash(storedHash) % printHash(hash));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue