From 294c558d577cd4acb2ee8e94e0dfd6acdb946c6c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 7 Dec 2018 23:12:05 +0300 Subject: Add support for build configuration class inheritance --- mod/mod-build-result.cxx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'mod/mod-build-result.cxx') diff --git a/mod/mod-build-result.cxx b/mod/mod-build-result.cxx index 177e67f..5f671d3 100644 --- a/mod/mod-build-result.cxx +++ b/mod/mod-build-result.cxx @@ -23,8 +23,8 @@ #include #include +#include // *_url() #include -#include // *_url() using namespace std; using namespace butl; @@ -39,6 +39,7 @@ using namespace odb::core; brep::build_result:: build_result (const build_result& r) : database_module (r), + build_config_module (r), options_ (r.initialized_ ? r.options_ : nullptr) { } @@ -55,10 +56,13 @@ init (scanner& s) options_->package_db_retry ()); if (options_->build_config_specified ()) - database_module::init (static_cast (*options_), - static_cast (*options_), + { + database_module::init (static_cast (*options_), options_->build_db_retry ()); + build_config_module::init (static_cast (*options_)); + } + if (options_->root ().empty ()) options_->root (dir_path ("/")); } @@ -312,18 +316,18 @@ handle (request& rq, response&) warn_auth (rqm.challenge ? "unexpected challenge" : "challenge is expected"); - else if (bot_agent_keys_ == nullptr) // Authentication is disabled. + else if (bot_agent_key_map_ == nullptr) // Authentication is disabled. auth = true; else if (!b->agent_challenge) // Authentication is recently enabled. warn_auth ("challenge is required now"); else { assert (b->agent_fingerprint && rqm.challenge); - auto i (bot_agent_keys_->find (*b->agent_fingerprint)); + auto i (bot_agent_key_map_->find (*b->agent_fingerprint)); // The agent's key is recently replaced. // - if (i == bot_agent_keys_->end ()) + if (i == bot_agent_key_map_->end ()) warn_auth ("agent's public key not found"); else { @@ -400,7 +404,8 @@ handle (request& rq, response&) shared_ptr p ( build_db_->load (b->id.package)); - if (belongs (*cfg, "all") && !exclude (*p, *cfg)) + if (belongs (*cfg, "all") && + !exclude (p->builds, p->constraints, *cfg)) bld = move (b); } } @@ -458,7 +463,7 @@ handle (request& rq, response&) os << "Force rebuild (enter the reason, use '+' instead of spaces):" << endl << endl - << " " << force_rebuild_url (host, root, *bld) << endl; + << " " << build_force_url (host, root, *bld) << endl; } sm.out.close (); -- cgit v1.1