* Implement RemoteStore::queryValidPaths().

This commit is contained in:
Eelco Dolstra 2010-02-26 12:05:01 +00:00
parent e42401ee7b
commit 24035b98b1
3 changed files with 12 additions and 1 deletions

View file

@ -214,7 +214,9 @@ bool RemoteStore::isValidPath(const Path & path)
PathSet RemoteStore::queryValidPaths()
{
openConnection();
throw Error("not implemented");
writeInt(wopQueryValidPaths, to);
processStderr();
return readStorePaths(from);
}

View file

@ -35,6 +35,7 @@ typedef enum {
wopCollectGarbage = 20,
wopQuerySubstitutablePathInfo = 21,
wopQueryDerivationOutputs = 22,
wopQueryValidPaths = 23,
} WorkerOp;

View file

@ -520,6 +520,14 @@ static void performOp(unsigned int clientVersion,
break;
}
case wopQueryValidPaths: {
startWork();
PathSet paths = store->queryValidPaths();
stopWork();
writeStringSet(paths, to);
break;
}
default:
throw Error(format("invalid operation %1%") % op);
}