forked from lix-project/lix
nix-store --serve: Don't loop forever
nix-store --export takes a tmproot, which can only release by exiting. Substituters don't currently work in a way that could take advantage of the looping, anyway. Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
3a38d0f356
commit
9488447594
|
@ -260,32 +260,31 @@ string StoreAPI::makeValidityRegistration(const PathSet & paths,
|
||||||
|
|
||||||
void StoreAPI::serve(Source & in, Sink & out, bool sign)
|
void StoreAPI::serve(Source & in, Sink & out, bool sign)
|
||||||
{
|
{
|
||||||
for (string cmd = readString(in); !cmd.empty(); cmd = readString(in)) {
|
string cmd = readString(in);
|
||||||
if (cmd == "query") {
|
if (cmd == "query") {
|
||||||
for (cmd = readString(in); !cmd.empty(); cmd = readString(in)) {
|
for (cmd = readString(in); !cmd.empty(); cmd = readString(in)) {
|
||||||
PathSet paths = readStrings<PathSet>(in);
|
PathSet paths = readStrings<PathSet>(in);
|
||||||
if (cmd == "have") {
|
if (cmd == "have") {
|
||||||
writeStrings(queryValidPaths(paths), out);
|
writeStrings(queryValidPaths(paths), out);
|
||||||
} else if (cmd == "info") {
|
} else if (cmd == "info") {
|
||||||
// !!! Maybe we want a queryPathInfos?
|
// !!! Maybe we want a queryPathInfos?
|
||||||
foreach (PathSet::iterator, i, paths) {
|
foreach (PathSet::iterator, i, paths) {
|
||||||
ValidPathInfo info = queryPathInfo(*i);
|
ValidPathInfo info = queryPathInfo(*i);
|
||||||
writeString(info.path, out);
|
writeString(info.path, out);
|
||||||
writeString(info.deriver, out);
|
writeString(info.deriver, out);
|
||||||
writeStrings(info.references, out);
|
writeStrings(info.references, out);
|
||||||
// !!! Maybe we want compression?
|
// !!! Maybe we want compression?
|
||||||
writeLongLong(info.narSize, out); // downloadSize
|
writeLongLong(info.narSize, out); // downloadSize
|
||||||
writeLongLong(info.narSize, out);
|
writeLongLong(info.narSize, out);
|
||||||
}
|
}
|
||||||
writeString("", out);
|
writeString("", out);
|
||||||
} else
|
} else
|
||||||
throw Error(format("Unknown serve query `%1%'") % cmd);
|
throw Error(format("Unknown serve query `%1%'") % cmd);
|
||||||
}
|
}
|
||||||
} else if (cmd == "substitute")
|
} else if (cmd == "substitute")
|
||||||
exportPath(readString(in), sign, out);
|
exportPath(readString(in), sign, out);
|
||||||
else
|
else
|
||||||
throw Error(format("Unknown serve command `%1%'") % cmd);
|
throw Error(format("Unknown serve command `%1%'") % cmd);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue