libexpr: Migrate emitTreeAttrs to return a Value
Part of #1136 and progress towards #744 Change-Id: Iaa011161b26bda237bcf4424bf8262726a6a6964
This commit is contained in:
@@ -943,16 +943,14 @@ LockedFlake lockFlake(
|
||||
Value callFlake(EvalState & state, const LockedFlake & lockedFlake)
|
||||
{
|
||||
Value vLocks;
|
||||
Value vRootSrc;
|
||||
Value vRootSubdir;
|
||||
|
||||
vLocks = {NewValueAs::string, lockedFlake.lockFile.to_string()};
|
||||
|
||||
emitTreeAttrs(
|
||||
Value vRootSrc = emitTreeAttrs(
|
||||
state.ctx,
|
||||
*lockedFlake.flake.sourceInfo,
|
||||
lockedFlake.flake.lockedRef.input,
|
||||
vRootSrc,
|
||||
false,
|
||||
lockedFlake.flake.forceDirty
|
||||
);
|
||||
|
||||
@@ -202,12 +202,11 @@ LockedFlake lockFlake(
|
||||
Value callFlake(EvalState & state, const LockedFlake & lockedFlake);
|
||||
}
|
||||
|
||||
void emitTreeAttrs(
|
||||
Value emitTreeAttrs(
|
||||
Evaluator & state,
|
||||
const fetchers::Tree & tree,
|
||||
const fetchers::Input & input,
|
||||
Value & v,
|
||||
bool emptyRevFallback = false,
|
||||
bool forceDirty = false);
|
||||
|
||||
bool forceDirty = false
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
|
||||
namespace nix {
|
||||
|
||||
void emitTreeAttrs(
|
||||
Value emitTreeAttrs(
|
||||
Evaluator & state,
|
||||
const fetchers::Tree & tree,
|
||||
const fetchers::Input & input,
|
||||
Value & v,
|
||||
bool emptyRevFallback,
|
||||
bool forceDirty)
|
||||
bool forceDirty
|
||||
)
|
||||
{
|
||||
assert(input.isLocked());
|
||||
|
||||
@@ -71,7 +71,7 @@ void emitTreeAttrs(
|
||||
};
|
||||
}
|
||||
|
||||
v = {NewValueAs::attrs, attrs};
|
||||
return {NewValueAs::attrs, attrs};
|
||||
}
|
||||
|
||||
std::string fixURI(std::string uri, EvalState & state, const std::string & defaultScheme = "file")
|
||||
@@ -223,7 +223,7 @@ static void fetchTree(
|
||||
|
||||
state.ctx.paths.allowPath(tree.storePath);
|
||||
|
||||
emitTreeAttrs(state.ctx, tree, input2, v, params.emptyRevFallback, false);
|
||||
v = emitTreeAttrs(state.ctx, tree, input2, params.emptyRevFallback, false);
|
||||
}
|
||||
|
||||
void prim_fetchTree(EvalState & state, Value * * args, Value & v)
|
||||
|
||||
Reference in New Issue
Block a user