aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/derivations.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-01-21 21:18:52 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-01-21 21:18:52 +0100
commit6fadb3fc03a1a3d51a1aaea003bfbe347c3879b3 (patch)
tree2bd6687cc2c2cb83a9ed4666ed06afb5c8a967ec /src/libstore/derivations.cc
parent62f712c8aedc08d6478ce9b380a2cf317d7e4d3a (diff)
parentaef635da78d33bf679f49fd10e7130d918a82549 (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/libstore/derivations.cc')
-rw-r--r--src/libstore/derivations.cc32
1 files changed, 10 insertions, 22 deletions
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index 1a061149a..d9da8769c 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -246,30 +246,18 @@ string Derivation::unparse(const Store & store, bool maskOutputs,
s.reserve(65536);
s += "Derive([";
- StringSet maskedOutputs;
-
- if (maskOutputs) {
- bool first = true;
- maskedOutputs = tokenizeString<StringSet>(get(env, "outputs").value_or("out"), " ");
- for (auto & i : maskedOutputs) {
- if (first) first = false; else s += ',';
- s += '('; printString(s, i);
- s += ",\"\",\"\",\"\")";
- }
- } else {
- bool first = true;
- for (auto & i : outputs) {
- if (first) first = false; else s += ',';
- s += '('; printString(s, i.first);
- s += ','; printString(s, store.printStorePath(i.second.path));
- s += ','; printString(s, i.second.hashAlgo);
- s += ','; printString(s, i.second.hash);
- s += ')';
- }
+ bool first = true;
+ for (auto & i : outputs) {
+ if (first) first = false; else s += ',';
+ s += '('; printString(s, i.first);
+ s += ','; printString(s, maskOutputs ? "" : store.printStorePath(i.second.path));
+ s += ','; printString(s, i.second.hashAlgo);
+ s += ','; printString(s, i.second.hash);
+ s += ')';
}
s += "],[";
- bool first = true;
+ first = true;
if (actualInputs) {
for (auto & i : *actualInputs) {
if (first) first = false; else s += ',';
@@ -299,7 +287,7 @@ string Derivation::unparse(const Store & store, bool maskOutputs,
for (auto & i : env) {
if (first) first = false; else s += ',';
s += '('; printString(s, i.first);
- s += ','; printString(s, maskOutputs && maskedOutputs.count(i.first) ? "" : i.second);
+ s += ','; printString(s, maskOutputs && outputs.count(i.first) ? "" : i.second);
s += ')';
}