From a82e565d7f426f6bdd4acd4e07ac5ba07d504d17 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 7 Oct 2024 18:20:34 +0100 Subject: Accept + in USE flag name of dependency string --- gentoobrowse-api/service/depend.cpp | 2 +- gentoobrowse-api/unittests/testDepend.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gentoobrowse-api/service/depend.cpp b/gentoobrowse-api/service/depend.cpp index 4cfc1b4..179eea0 100644 --- a/gentoobrowse-api/service/depend.cpp +++ b/gentoobrowse-api/service/depend.cpp @@ -11,7 +11,7 @@ namespace Portage::Utils { AdHoc::Lexer::PatternPtr WhenUse_Begin( - AdHoc::LexerMatchers::regex(R"(\s*(!?[[:alnum:]_@-]+)\?\s*\(\s*)", G_REGEX_OPTIMIZE)); + AdHoc::LexerMatchers::regex(R"(\s*(!?[[:alnum:]_@+-]+)\?\s*\(\s*)", G_REGEX_OPTIMIZE)); AdHoc::Lexer::PatternPtr WhenUse_End(AdHoc::LexerMatchers::regex(R"(\s*\)\s*)", G_REGEX_OPTIMIZE)); AdHoc::Lexer::PatternPtr Or_Begin(AdHoc::LexerMatchers::regex(R"(\s*\|\|\s*\(\s*)", G_REGEX_OPTIMIZE)); AdHoc::Lexer::PatternPtr Or_Group(AdHoc::LexerMatchers::regex(R"(\s*\(\s*)", G_REGEX_OPTIMIZE)); diff --git a/gentoobrowse-api/unittests/testDepend.cpp b/gentoobrowse-api/unittests/testDepend.cpp index a02c87a..52a020f 100644 --- a/gentoobrowse-api/unittests/testDepend.cpp +++ b/gentoobrowse-api/unittests/testDepend.cpp @@ -293,6 +293,15 @@ BOOST_AUTO_TEST_CASE(wine_staging) BOOST_REQUIRE_EQUAL(ds.size(), 9); } +BOOST_AUTO_TEST_CASE(ccache) +{ + auto ds = Portage::Utils::Depend::parse( + ">=app-arch/zstd-1.3.4:= !static-c++? ( >=dev-cpp/cpp-httplib-0.10.6:= >=dev-libs/libfmt-8.0.0:= ) " + ">=dev-libs/blake3-1.4.0:= >=dev-libs/xxhash-0.8.0 redis? ( >=dev-libs/hiredis-0.13.3:= ) " + "dev-util/shadowman sys-apps/gentoo-functions"); + BOOST_REQUIRE_EQUAL(ds.size(), 8); +} + BOOST_AUTO_TEST_CASE(useWithAtSymble) { auto ds = Portage::Utils::Depend::parse("some@thing? ( app-arch/bzip2 )"); -- cgit v1.2.3