* 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);
}