1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

checkRefs: use concatMapStringsSep

This commit is contained in:
Robert Hensing 2025-01-18 09:58:17 +01:00 committed by Sergei Trofimovich
parent 32898dc46a
commit 2b4d461c14

View file

@ -2992,15 +2992,10 @@ void LocalDerivationGoal::checkOutputs(const std::map<std::string, ValidPathInfo
else if (auto output = get(outputs, i)) else if (auto output = get(outputs, i))
spec.insert(output->path); spec.insert(output->path);
else { else {
std::string allOutputs; std::string outputsListing = concatMapStringsSep(", ", outputs, [](auto & o) { return o.first; });
for (auto & o : outputs) {
if (! allOutputs.empty())
allOutputs.append(", ");
allOutputs.append(o.first);
}
throw BuildError("derivation '%s' output check for '%s' contains an illegal reference specifier '%s'," throw BuildError("derivation '%s' output check for '%s' contains an illegal reference specifier '%s',"
" expected store path or output name (one of [%s])", " expected store path or output name (one of [%s])",
worker.store.printStorePath(drvPath), outputName, i, allOutputs); worker.store.printStorePath(drvPath), outputName, i, outputsListing);
} }
} }