* Support exportPath() in remote mode.
This commit is contained in:
parent
dc7d594776
commit
0f5da8a83c
4 changed files with 42 additions and 5 deletions
|
|
@ -178,6 +178,21 @@ static void stopWork(bool success = true, const string & msg = "")
|
|||
}
|
||||
|
||||
|
||||
struct TunnelSink : Sink
|
||||
{
|
||||
Sink & to;
|
||||
TunnelSink(Sink & to) : to(to)
|
||||
{
|
||||
}
|
||||
virtual void operator ()
|
||||
(const unsigned char * data, unsigned int len)
|
||||
{
|
||||
writeInt(STDERR_DATA, to);
|
||||
writeString(string((const char *) data, len), to);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static void performOp(Source & from, Sink & to, unsigned int op)
|
||||
{
|
||||
switch (op) {
|
||||
|
|
@ -263,6 +278,17 @@ static void performOp(Source & from, Sink & to, unsigned int op)
|
|||
break;
|
||||
}
|
||||
|
||||
case wopExportPath: {
|
||||
Path path = readStorePath(from);
|
||||
bool sign = readInt(from) == 1;
|
||||
startWork();
|
||||
TunnelSink sink(to);
|
||||
store->exportPath(path, sign, sink);
|
||||
stopWork();
|
||||
writeInt(1, to);
|
||||
break;
|
||||
}
|
||||
|
||||
case wopBuildDerivations: {
|
||||
PathSet drvs = readStorePaths(from);
|
||||
startWork();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue