forked from lix-project/lix
nix: Remove special handling of .drv files
This makes 'nix copy' and 'nix path-info' work on .drv store paths. Removing special treatment of .drv files seems the most future-proof approach given the possible removal of .drv files in the future. Note that 'nix build' will still build (rather than substitute) .drv paths due to the unfortunate overloading in Store::buildPaths().
This commit is contained in:
parent
7902fccf6f
commit
85530bcc0b
|
@ -86,22 +86,6 @@ Buildable Installable::toBuildable()
|
||||||
return std::move(buildables[0]);
|
return std::move(buildables[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct InstallableStoreDrv : Installable
|
|
||||||
{
|
|
||||||
Path drvPath;
|
|
||||||
|
|
||||||
InstallableStoreDrv(const Path & drvPath) : drvPath(drvPath) { }
|
|
||||||
|
|
||||||
std::string what() override { return drvPath; }
|
|
||||||
|
|
||||||
Buildables toBuildables() override
|
|
||||||
{
|
|
||||||
Buildable b = {drvPath};
|
|
||||||
// FIXME: add outputs?
|
|
||||||
return {b};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct InstallableStorePath : Installable
|
struct InstallableStorePath : Installable
|
||||||
{
|
{
|
||||||
Path storePath;
|
Path storePath;
|
||||||
|
@ -226,12 +210,8 @@ static std::vector<std::shared_ptr<Installable>> parseInstallables(
|
||||||
|
|
||||||
auto path = store->toStorePath(store->followLinksToStore(s));
|
auto path = store->toStorePath(store->followLinksToStore(s));
|
||||||
|
|
||||||
if (store->isStorePath(path)) {
|
if (store->isStorePath(path))
|
||||||
if (isDerivation(path))
|
result.push_back(std::make_shared<InstallableStorePath>(path));
|
||||||
result.push_back(std::make_shared<InstallableStoreDrv>(path));
|
|
||||||
else
|
|
||||||
result.push_back(std::make_shared<InstallableStorePath>(path));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (s == "" || std::regex_match(s, attrPathRegex))
|
else if (s == "" || std::regex_match(s, attrPathRegex))
|
||||||
|
|
Loading…
Reference in a new issue