From 4b9be1cb87c4759ca08aa89acd9e9fd7ba5b18be Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 6 Jul 2017 20:28:22 +0300 Subject: Add support for build include/exclude manifest values --- mod/build-config.cxx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'mod/build-config.cxx') diff --git a/mod/build-config.cxx b/mod/build-config.cxx index 6b59e54..fed2ee9 100644 --- a/mod/build-config.cxx +++ b/mod/build-config.cxx @@ -146,4 +146,31 @@ namespace brep "&cf=" + mime_url_encode (b.configuration) + "&tc=" + b.toolchain_version.string () + "&reason="; } + + bool + match (const string& config_pattern, const optional& target_pattern, + const build_config& c) + { + return path_match (config_pattern, c.name) && + (!target_pattern || + (c.target && path_match (*target_pattern, c.target->string ()))); + } + + bool + exclude (const build_package& p, const build_config& c) + { + for (const auto& bc: p.constraints) + { + if (!bc.exclusion && match (bc.config, bc.target, c)) + return false; + } + + for (const auto& bc: p.constraints) + { + if (bc.exclusion && match (bc.config, bc.target, c)) + return true; + } + + return false; + } } -- cgit v1.1