diff options
author | Guillaume Maudoux <guillaume.maudoux@tweag.io> | 2022-01-11 11:57:45 +0100 |
---|---|---|
committer | Guillaume Maudoux <guillaume.maudoux@tweag.io> | 2022-01-11 11:57:45 +0100 |
commit | e9a4abdb5d6fe8e128372a77d879b0187b1bacfe (patch) | |
tree | 0e1b541da8e5b7d9ebab7fdf94b3f4a209d02393 /src/libstore/local-store.cc | |
parent | c260640dec6e35c714b666a1e7adede5aab6972a (diff) |
Make --repair-path also repair corrupt optimised links
There already existed a smoke test for the link content length,
but it appears that there exists some corruptions pernicious enough
to replace the file content with zeros, and keeping the same length.
--repair-path now goes as far as checking the content of the link,
making it true to its name and actually repairing the path for such
coruption cases.
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r-- | src/libstore/local-store.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 1b8e77ead..9ebdfd6ed 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1307,7 +1307,7 @@ void LocalStore::addToStore(const ValidPathInfo & info, Source & source, canonicalisePathMetaData(realPath, -1); - optimisePath(realPath); // FIXME: combine with hashPath() + optimisePath(realPath, repair); // FIXME: combine with hashPath() registerValidPath(info); } @@ -1419,7 +1419,7 @@ StorePath LocalStore::addToStoreFromDump(Source & source0, const string & name, canonicalisePathMetaData(realPath, -1); // FIXME: merge into restorePath - optimisePath(realPath); + optimisePath(realPath, repair); ValidPathInfo info { dstPath, narHash.first }; info.narSize = narHash.second; @@ -1463,7 +1463,7 @@ StorePath LocalStore::addTextToStore(const string & name, const string & s, dumpString(s, sink); auto narHash = hashString(htSHA256, *sink.s); - optimisePath(realPath); + optimisePath(realPath, repair); ValidPathInfo info { dstPath, narHash }; info.narSize = sink.s->size(); |