1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 09:31:16 +02:00

Fix build to use CanonPath in new FSO sinks

This commit is contained in:
Robert Hensing 2024-07-11 12:14:48 +02:00
parent 86420753ec
commit 4fd8f19ecf
6 changed files with 30 additions and 24 deletions

View file

@ -909,9 +909,12 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
addToTree(*pathComponents.rbegin(), oid, GIT_FILEMODE_LINK);
}
void createHardlink(const Path & path, const CanonPath & target) override
void createHardlink(const CanonPath & path, const CanonPath & target) override
{
auto pathComponents = tokenizeString<std::vector<std::string>>(path, "/");
std::vector<std::string> pathComponents;
for (auto & c : path)
pathComponents.emplace_back(c);
if (!prepareDirs(pathComponents, false)) return;
// We can't just look up the path from the start of the root, since

View file

@ -51,7 +51,7 @@ struct ExtendedFileSystemObjectSink : virtual FileSystemObjectSink
* Create a hard link. The target must be the path of a previously
* encountered file relative to the root of the FSO.
*/
virtual void createHardlink(const Path & path, const CanonPath & target) = 0;
virtual void createHardlink(const CanonPath & path, const CanonPath & target) = 0;
};
/**

View file

@ -196,7 +196,7 @@ time_t unpackTarfileToSink(TarArchive & archive, ExtendedFileSystemObjectSink &
lastModified = std::max(lastModified, archive_entry_mtime(entry));
if (auto target = archive_entry_hardlink(entry)) {
parseSink.createHardlink(path, CanonPath(target));
parseSink.createHardlink(cpath, CanonPath(target));
continue;
}