aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/outputs-spec.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-01-18 17:09:15 +0100
committerGitHub <noreply@github.com>2023-01-18 17:09:15 +0100
commit0510aa40a3f48907e65727b803333faf395264e6 (patch)
tree4484734515998c3d6120e442c99e5577b7d3aa25 /src/libstore/outputs-spec.cc
parent70e193d64bc5507746682f6983db67faf494deed (diff)
parent75c89c3e5ea4b4b6a47a3c13aec8b3ac5c324fa5 (diff)
Merge pull request #7631 from edolstra/output-names
OutputSpec: Allow all valid output names
Diffstat (limited to 'src/libstore/outputs-spec.cc')
-rw-r--r--src/libstore/outputs-spec.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstore/outputs-spec.cc b/src/libstore/outputs-spec.cc
index a9e4320d5..096443cb2 100644
--- a/src/libstore/outputs-spec.cc
+++ b/src/libstore/outputs-spec.cc
@@ -21,7 +21,8 @@ bool OutputsSpec::contains(const std::string & outputName) const
std::optional<OutputsSpec> OutputsSpec::parseOpt(std::string_view s)
{
- static std::regex regex(R"((\*)|([a-z]+(,[a-z]+)*))");
+ // See checkName() for valid output name characters.
+ static std::regex regex(R"((\*)|([a-zA-Z\+\-\._\?=]+(,[a-zA-Z\+\-\._\?=]+)*))");
std::smatch match;
std::string s2 { s }; // until some improves std::regex
@@ -42,7 +43,7 @@ OutputsSpec OutputsSpec::parse(std::string_view s)
{
std::optional spec = parseOpt(s);
if (!spec)
- throw Error("Invalid outputs specifier: '%s'", s);
+ throw Error("invalid outputs specifier '%s'", s);
return *spec;
}
@@ -65,7 +66,7 @@ std::pair<std::string_view, ExtendedOutputsSpec> ExtendedOutputsSpec::parse(std:
{
std::optional spec = parseOpt(s);
if (!spec)
- throw Error("Invalid extended outputs specifier: '%s'", s);
+ throw Error("invalid extended outputs specifier '%s'", s);
return *spec;
}