Use the new interface
This commit is contained in:
@@ -305,8 +305,8 @@ struct InstallableStorePath : Installable
|
||||
if (storePath.isDerivation()) {
|
||||
std::map<std::string, StorePath> outputs;
|
||||
auto drv = store->readDerivation(storePath);
|
||||
for (auto & [name, output] : drv.outputs)
|
||||
outputs.emplace(name, output.path(*store, drv.name));
|
||||
for (auto & i : drv.outputsAndPaths(*store))
|
||||
outputs.emplace(i.first, i.second.second);
|
||||
return {
|
||||
Buildable {
|
||||
.drvPath = storePath,
|
||||
|
||||
+2
-2
@@ -485,8 +485,8 @@ bool NixRepl::processLine(string line)
|
||||
if (runProgram(settings.nixBinDir + "/nix", Strings{"build", "--no-link", drvPath}) == 0) {
|
||||
auto drv = readDerivation(*state->store, drvPath, Derivation::nameFromPath(state->store->parseStorePath(drvPath)));
|
||||
std::cout << std::endl << "this derivation produced the following outputs:" << std::endl;
|
||||
for (auto & i : drv.outputs)
|
||||
std::cout << fmt(" %s -> %s\n", i.first, state->store->printStorePath(i.second.path(*state->store, drv.name)));
|
||||
for (auto & i : drv.outputsAndPaths(*state->store))
|
||||
std::cout << fmt(" %s -> %s\n", i.first, state->store->printStorePath(i.second.second));
|
||||
}
|
||||
} else if (command == ":i") {
|
||||
runProgram(settings.nixBinDir + "/nix-env", Strings{"-i", drvPath});
|
||||
|
||||
@@ -67,9 +67,9 @@ struct CmdShowDerivation : InstallablesCommand
|
||||
|
||||
{
|
||||
auto outputsObj(drvObj.object("outputs"));
|
||||
for (auto & output : drv.outputs) {
|
||||
for (auto & output : drv.outputsAndPaths(*store)) {
|
||||
auto outputObj(outputsObj.object(output.first));
|
||||
outputObj.attr("path", store->printStorePath(output.second.path(*store, drv.name)));
|
||||
outputObj.attr("path", store->printStorePath(output.second.second));
|
||||
|
||||
std::visit(overloaded {
|
||||
[&](DerivationOutputInputAddressed doi) {
|
||||
@@ -81,7 +81,7 @@ struct CmdShowDerivation : InstallablesCommand
|
||||
[&](DerivationOutputFloating dof) {
|
||||
outputObj.attr("hashAlgo", makeFileIngestionPrefix(dof.method) + printHashType(dof.hashType));
|
||||
},
|
||||
}, output.second.output);
|
||||
}, output.second.first.output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user