Make InstallableStorePath behave consistently with InstallableValue
That is, the commands 'nix path-info nixpkgs#hello' and 'nix path-info /nix/store/00ls0qi49qkqpqblmvz5s1ajl3gc63lr-hello-2.10.drv' now do the same thing (i.e. build the derivation and operate on the output store path, rather than the .drv path).
This commit is contained in:
parent
298ff6af8f
commit
e3c2b00237
1 changed files with 18 additions and 9 deletions
|
@ -296,15 +296,24 @@ struct InstallableStorePath : Installable
|
||||||
|
|
||||||
Buildables toBuildables() override
|
Buildables toBuildables() override
|
||||||
{
|
{
|
||||||
std::map<std::string, StorePath> outputs;
|
if (storePath.isDerivation()) {
|
||||||
outputs.insert_or_assign("out", storePath);
|
std::map<std::string, StorePath> outputs;
|
||||||
Buildable b{
|
for (auto & [name, output] : store->readDerivation(storePath).outputs)
|
||||||
.drvPath = storePath.isDerivation() ? storePath : std::optional<StorePath>(),
|
outputs.emplace(name, output.path);
|
||||||
.outputs = std::move(outputs)
|
return {
|
||||||
};
|
Buildable {
|
||||||
Buildables bs;
|
.drvPath = storePath,
|
||||||
bs.push_back(std::move(b));
|
.outputs = std::move(outputs)
|
||||||
return bs;
|
}
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
Buildable {
|
||||||
|
.drvPath = {},
|
||||||
|
.outputs = {{"out", storePath}}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<StorePath> getStorePath() override
|
std::optional<StorePath> getStorePath() override
|
||||||
|
|
Loading…
Reference in a new issue