1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Pass lists/attrsets to bash as (associative) arrays

This commit is contained in:
Eelco Dolstra 2017-10-25 13:01:50 +02:00
parent ac12517f3e
commit 2d5b1b24bf
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
10 changed files with 166 additions and 26 deletions

View file

@ -713,7 +713,7 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
if (outputHashRecursive) outputHashAlgo = "r:" + outputHashAlgo;
Path outPath = state.store->makeFixedOutputPath(outputHashRecursive, h, drvName);
drv.env["out"] = outPath;
if (!jsonObject) drv.env["out"] = outPath;
drv.outputs["out"] = DerivationOutput(outPath, outputHashAlgo, *outputHash);
}
@ -724,7 +724,7 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
an empty value. This ensures that changes in the set of
output names do get reflected in the hash. */
for (auto & i : outputs) {
drv.env[i] = "";
if (!jsonObject) drv.env[i] = "";
drv.outputs[i] = DerivationOutput("", "", "");
}
@ -735,7 +735,7 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
for (auto & i : drv.outputs)
if (i.second.path == "") {
Path outPath = state.store->makeOutputPath(i.first, h, drvName);
drv.env[i.first] = outPath;
if (!jsonObject) drv.env[i.first] = outPath;
i.second.path = outPath;
}
}