1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 10:31:15 +02:00

Implement nar-based addToStore for remote-store

This commit is contained in:
Shea Levy 2016-09-02 14:33:58 -04:00
parent ecba88de93
commit 584f8a62de
3 changed files with 31 additions and 2 deletions

View file

@ -579,7 +579,30 @@ static void performOp(ref<LocalStore> store, bool trusted, unsigned int clientVe
case wopNarFromPath: {
auto path = readStorePath(*store, from);
startWork();
stopWork();
dumpPath(path, to);
break;
}
case wopAddToStoreNar: {
ValidPathInfo info;
info.path = readStorePath(*store, from);
info.deriver = readString(from);
if (!info.deriver.empty())
store->assertStorePath(info.deriver);
info.narHash = parseHash(htSHA256, readString(from));
info.references = readStorePaths<PathSet>(*store, from);
info.registrationTime = readInt(from);
info.narSize = readLongLong(from);
info.ultimate = readLongLong(from);
info.sigs = readStrings<StringSet>(from);
auto nar = readString(from);
auto repair = readInt(from) ? true : false;
auto dontCheckSigs = readInt(from) ? true : false;
if (!trusted && dontCheckSigs)
dontCheckSigs = false;
startWork();
store->addToStore(info, nar, repair, dontCheckSigs);
stopWork();
break;
}