1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 03:23:16 +02:00

Checkpoint

This commit is contained in:
Eelco Dolstra 2022-02-15 16:38:22 +01:00
parent e827e6288f
commit 3ec83565b1
11 changed files with 116 additions and 39 deletions

View file

@ -16,15 +16,14 @@ Path EvalState::packPath(const SourcePath & path)
SourcePath EvalState::unpackPath(const Path & path)
{
printError("UNPACK %s", path);
if (hasPrefix(path, marker)) {
auto s = path.substr(marker.size());
auto slash = s.find('/');
assert(slash != s.npos);
auto n = std::stoi(s.substr(0, slash));
printError("GOT %d", n);
auto i = inputAccessors.find(n);
assert(i != inputAccessors.end());
return {i->second, s.substr(slash)};
return {i->second, slash != std::string::npos ? s.substr(slash) : "/"};
} else {
printError("FIXME: %s", path);
return rootPath(path);