From 22059500a799d788c09171e31b668ab8259ec057 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 17 Nov 2018 23:41:25 +0300 Subject: Add support for builds manifest value --- mod/build-config.hxx | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'mod/build-config.hxx') diff --git a/mod/build-config.hxx b/mod/build-config.hxx index cdc7efb..e7ee9eb 100644 --- a/mod/build-config.hxx +++ b/mod/build-config.hxx @@ -6,6 +6,7 @@ #define MOD_BUILD_CONFIG_HXX #include +#include // find() #include @@ -21,6 +22,8 @@ // namespace brep { + using bbot::build_config; + // Return pointer to the shared build configurations instance, creating one // on the first call. Throw tab_parsing on parsing error, io_error on the // underlying OS error. Is not thread-safe. @@ -52,17 +55,31 @@ namespace brep string force_rebuild_url (const string& host, const dir_path& root, const build&); - // Match a build configuration against the name and target patterns. + // Check if the configuration belongs to the specified class. // - bool - match (const string& config_pattern, - const optional& target_pattern, - const bbot::build_config&); + inline bool + belongs (const build_config& cfg, const char* cls) + { + const strings& cs (cfg.classes); + return find (cs.begin (), cs.end (), cls) != cs.end (); + } - // Return true if a package excludes the specified build configuration. + // Return true if the specified build configuration is excluded by a package + // based on its underlying build class set, build class expressions, and + // build constraints, potentially extending the underlying set with the + // special classes. Set the exclusion reason if requested. // bool - exclude (const build_package&, const bbot::build_config&); + exclude (const build_class_exprs&, + const build_constraints&, + const build_config&, + string* reason = nullptr); + + inline bool + exclude (const build_package& p, const build_config& c, string* r = nullptr) + { + return exclude (p.builds, p.constraints, c, r); + } } #endif // MOD_BUILD_CONFIG_HXX -- cgit v1.1