Skip to content

Commit e42401e

Browse files
committed
* Implement RemoteStore::queryDerivationOutputs().
1 parent af565c3 commit e42401e

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/libstore/remote-store.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,11 @@ Path RemoteStore::queryDeriver(const Path & path)
296296

297297
PathSet RemoteStore::queryDerivationOutputs(const Path & path)
298298
{
299-
throw Error("not yet implemented");
299+
openConnection();
300+
writeInt(wopQueryDerivationOutputs, to);
301+
writeString(path, to);
302+
processStderr();
303+
return readStorePaths(from);
300304
}
301305

302306

src/libstore/worker-protocol.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ typedef enum {
3434
wopSetOptions = 19,
3535
wopCollectGarbage = 20,
3636
wopQuerySubstitutablePathInfo = 21,
37+
wopQueryDerivationOutputs = 22,
3738
} WorkerOp;
3839

3940

src/nix-worker/nix-worker.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,16 @@ static void performOp(unsigned int clientVersion,
313313
}
314314

315315
case wopQueryReferences:
316-
case wopQueryReferrers: {
316+
case wopQueryReferrers:
317+
case wopQueryDerivationOutputs: {
317318
Path path = readStorePath(from);
318319
startWork();
319320
PathSet paths;
320321
if (op == wopQueryReferences)
321322
store->queryReferences(path, paths);
322-
else
323+
else if (op == wopQueryReferrers)
323324
store->queryReferrers(path, paths);
325+
else paths = store->queryDerivationOutputs(path);
324326
stopWork();
325327
writeStringSet(paths, to);
326328
break;

0 commit comments

Comments
 (0)