diff options
Diffstat (limited to 'src/libstore/derivations.cc')
-rw-r--r-- | src/libstore/derivations.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index e0a4f43c0b..1551ae28a8 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -252,4 +252,21 @@ Hash hashDerivationModulo(StoreAPI & store, Derivation drv) } +DrvPathWithOutputs parseDrvPathWithOutputs(const string & s) +{ + size_t n = s.find("!"); + return n == s.npos + ? DrvPathWithOutputs(s, std::set<string>()) + : DrvPathWithOutputs(string(s, 0, n), tokenizeString<std::set<string> >(string(s, n + 1), ",")); +} + + +Path makeDrvPathWithOutputs(const Path & drvPath, std::set<string> outputs) +{ + return outputs.empty() + ? drvPath + : drvPath + "!" + concatStringsSep(",", outputs); +} + + } |