From 5a06b17b91a5e13e9984fcb269c3d6ce7c929ff9 Mon Sep 17 00:00:00 2001 From: Justin ! Date: Mon, 7 Oct 2024 23:13:02 -0400 Subject: [PATCH] libutil: implement `PathsSetting` By implementing the `PathSet` specialization for `PathsSetting`, we'll be able to use `PathsSetting` for the `sandboxPaths` setting in `src/libstore/globals.hh`. Fixes: https://git.lix.systems/lix-project/lix/issues/498 Change-Id: I8bf7dfff98609d1774fdb36d63e57d787bcc829f --- src/libutil/config.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/libutil/config.cc b/src/libutil/config.cc index 778da1413..61df5825e 100644 --- a/src/libutil/config.cc +++ b/src/libutil/config.cc @@ -474,9 +474,22 @@ template<> Paths PathsSetting::parse(const std::string & str, const Apply return parsed; } +template<> PathSet PathsSetting::parse(const std::string &str, const ApplyConfigOptions & options) const +{ + auto strings = tokenizeString(str); + PathSet parsed; + + for (auto str : strings) { + parsed.insert(parsePath(*this, str, options)); + } + + return parsed; +} + template class PathsSetting; template class PathsSetting>; template class PathsSetting; +template class PathsSetting; bool GlobalConfig::set(const std::string & name, const std::string & value, const ApplyConfigOptions & options)