mirror of
https://github.com/NixOS/nix.git
synced 2025-11-29 13:41:00 +01:00
DerivationInfo -> PackageInfo
This does not yet resolve the coupling between packages and
derivations, but it makes the code more consistent with the
terminology, and it accentuates places where the coupling is
obvious, such as
auto drvPath = packageInfo.queryDrvPath();
if (!drvPath)
throw Error("'%s' is not a derivation", what());
... which isn't wrong, and in my opinion, doesn't even look
wrong, because it just reflects the current logic.
However, I do like that we can now start to see in the code that
this coupling is perhaps a bit arbitrary.
After this rename, we can bring the DerivingPath concept into type
and start to lift this limitation.
This commit is contained in:
parent
86156d05dd
commit
65255edc9b
13 changed files with 111 additions and 111 deletions
|
|
@ -15,9 +15,9 @@
|
|||
namespace nix {
|
||||
|
||||
|
||||
DrvInfos queryInstalled(EvalState & state, const Path & userEnv)
|
||||
PackageInfos queryInstalled(EvalState & state, const Path & userEnv)
|
||||
{
|
||||
DrvInfos elems;
|
||||
PackageInfos elems;
|
||||
if (pathExists(userEnv + "/manifest.json"))
|
||||
throw Error("profile '%s' is incompatible with 'nix-env'; please use 'nix profile' instead", userEnv);
|
||||
auto manifestFile = userEnv + "/manifest.nix";
|
||||
|
|
@ -31,7 +31,7 @@ DrvInfos queryInstalled(EvalState & state, const Path & userEnv)
|
|||
}
|
||||
|
||||
|
||||
bool createUserEnv(EvalState & state, DrvInfos & elems,
|
||||
bool createUserEnv(EvalState & state, PackageInfos & elems,
|
||||
const Path & profile, bool keepDerivations,
|
||||
const std::string & lockToken)
|
||||
{
|
||||
|
|
@ -57,7 +57,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
|
|||
output paths, and optionally the derivation path, as well
|
||||
as the meta attributes. */
|
||||
std::optional<StorePath> drvPath = keepDerivations ? i.queryDrvPath() : std::nullopt;
|
||||
DrvInfo::Outputs outputs = i.queryOutputs(true, true);
|
||||
PackageInfo::Outputs outputs = i.queryOutputs(true, true);
|
||||
StringSet metaNames = i.queryMetaNames();
|
||||
|
||||
auto attrs = state.buildBindings(7 + outputs.size());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue