forked from lix-project/lix
Importing derivations: Add name attribute to make a valid drv
This commit is contained in:
parent
1ed55234d9
commit
39e27a04b8
|
@ -1,10 +1,10 @@
|
||||||
attrs @ { drvPath, outputs, ... }:
|
attrs @ { drvPath, outputs, name, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
commonAttrs = (builtins.listToAttrs outputsList) //
|
commonAttrs = (builtins.listToAttrs outputsList) //
|
||||||
{ all = map (x: x.value) outputsList;
|
{ all = map (x: x.value) outputsList;
|
||||||
inherit drvPath;
|
inherit drvPath name;
|
||||||
type = "derivation";
|
type = "derivation";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -86,9 +86,11 @@ static void prim_scopedImport(EvalState & state, const Pos & pos, Value * * args
|
||||||
if (isStorePath(path) && store->isValidPath(path) && isDerivation(path)) {
|
if (isStorePath(path) && store->isValidPath(path) && isDerivation(path)) {
|
||||||
Derivation drv = readDerivation(path);
|
Derivation drv = readDerivation(path);
|
||||||
Value & w = *state.allocValue();
|
Value & w = *state.allocValue();
|
||||||
state.mkAttrs(w, 2 + drv.outputs.size());
|
state.mkAttrs(w, 3 + drv.outputs.size());
|
||||||
Value * v2 = state.allocAttr(w, state.sDrvPath);
|
Value * v2 = state.allocAttr(w, state.sDrvPath);
|
||||||
mkString(*v2, path, singleton<PathSet>("=" + path));
|
mkString(*v2, path, singleton<PathSet>("=" + path));
|
||||||
|
v2 = state.allocAttr(w, state.sName);
|
||||||
|
mkString(*v2, drv.env["name"]);
|
||||||
Value * outputsVal =
|
Value * outputsVal =
|
||||||
state.allocAttr(w, state.symbols.create("outputs"));
|
state.allocAttr(w, state.symbols.create("outputs"));
|
||||||
state.mkList(*outputsVal, drv.outputs.size());
|
state.mkList(*outputsVal, drv.outputs.size());
|
||||||
|
|
Loading…
Reference in a new issue