mirror of
https://github.com/NixOS/nix
synced 2025-06-28 22:01:15 +02:00
Remove redundant resolvedRef fields since they're already in SourceInfo
This commit is contained in:
parent
4846304541
commit
dda4f7167b
4 changed files with 36 additions and 34 deletions
|
@ -397,13 +397,17 @@ LockFile entryToLockFile(const LockFile::FlakeEntry & entry)
|
|||
|
||||
LockFile::FlakeEntry dependenciesToFlakeEntry(const ResolvedFlake & resolvedFlake)
|
||||
{
|
||||
LockFile::FlakeEntry entry(resolvedFlake.flake.resolvedRef, resolvedFlake.flake.sourceInfo.narHash);
|
||||
LockFile::FlakeEntry entry(
|
||||
resolvedFlake.flake.sourceInfo.resolvedRef,
|
||||
resolvedFlake.flake.sourceInfo.narHash);
|
||||
|
||||
for (auto & info : resolvedFlake.flakeDeps)
|
||||
entry.flakeEntries.insert_or_assign(info.first.to_string(), dependenciesToFlakeEntry(info.second));
|
||||
|
||||
for (auto & nonFlake : resolvedFlake.nonFlakeDeps) {
|
||||
LockFile::NonFlakeEntry nonEntry(nonFlake.resolvedRef, nonFlake.sourceInfo.narHash);
|
||||
LockFile::NonFlakeEntry nonEntry(
|
||||
nonFlake.sourceInfo.resolvedRef,
|
||||
nonFlake.sourceInfo.narHash);
|
||||
entry.nonFlakeEntries.insert_or_assign(nonFlake.alias, nonEntry);
|
||||
}
|
||||
|
||||
|
@ -540,11 +544,11 @@ void callFlake(EvalState & state, const ResolvedFlake & resFlake, Value & v)
|
|||
state.store->isValidPath(path);
|
||||
mkString(*state.allocAttr(v, state.sOutPath), path, {path});
|
||||
|
||||
if (resFlake.flake.resolvedRef.rev) {
|
||||
if (resFlake.flake.sourceInfo.resolvedRef.rev) {
|
||||
mkString(*state.allocAttr(v, state.symbols.create("rev")),
|
||||
resFlake.flake.resolvedRef.rev->gitRev());
|
||||
resFlake.flake.sourceInfo.resolvedRef.rev->gitRev());
|
||||
mkString(*state.allocAttr(v, state.symbols.create("shortRev")),
|
||||
resFlake.flake.resolvedRef.rev->gitShortRev());
|
||||
resFlake.flake.sourceInfo.resolvedRef.rev->gitShortRev());
|
||||
}
|
||||
|
||||
if (resFlake.flake.sourceInfo.revCount)
|
||||
|
|
|
@ -92,7 +92,6 @@ struct Flake
|
|||
{
|
||||
FlakeId id;
|
||||
FlakeRef originalRef;
|
||||
FlakeRef resolvedRef;
|
||||
std::string description;
|
||||
SourceInfo sourceInfo;
|
||||
std::vector<FlakeRef> requires;
|
||||
|
@ -100,18 +99,17 @@ struct Flake
|
|||
Value * vProvides; // FIXME: gc
|
||||
unsigned int epoch;
|
||||
|
||||
Flake(const FlakeRef & origRef, const SourceInfo & sourceInfo) : originalRef(origRef),
|
||||
resolvedRef(sourceInfo.resolvedRef), sourceInfo(sourceInfo) {};
|
||||
Flake(const FlakeRef & origRef, const SourceInfo & sourceInfo)
|
||||
: originalRef(origRef), sourceInfo(sourceInfo) {};
|
||||
};
|
||||
|
||||
struct NonFlake
|
||||
{
|
||||
FlakeAlias alias;
|
||||
FlakeRef originalRef;
|
||||
FlakeRef resolvedRef;
|
||||
SourceInfo sourceInfo;
|
||||
NonFlake(const FlakeRef & origRef, const SourceInfo & sourceInfo) :
|
||||
originalRef(origRef), resolvedRef(sourceInfo.resolvedRef), sourceInfo(sourceInfo) {};
|
||||
NonFlake(const FlakeRef & origRef, const SourceInfo & sourceInfo)
|
||||
: originalRef(origRef), sourceInfo(sourceInfo) {};
|
||||
};
|
||||
|
||||
Flake getFlake(EvalState &, const FlakeRef &, bool impureIsAllowed);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue