From 5163436b00711318baea4fc0ad43a4de8222354a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sun, 14 May 2017 00:37:16 +0300 Subject: Implement builds page --- mod/database-module.cxx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'mod/database-module.cxx') diff --git a/mod/database-module.cxx b/mod/database-module.cxx index 47cf03a..9daff53 100644 --- a/mod/database-module.cxx +++ b/mod/database-module.cxx @@ -20,6 +20,7 @@ namespace brep { using namespace std; using namespace butl; + using namespace bbot; // While currently the user-defined copy constructor is not required (we // don't need to deep copy nullptr's), it is a good idea to keep the @@ -31,7 +32,9 @@ namespace brep retry_ (r.retry_), package_db_ (r.initialized_ ? r.package_db_ : nullptr), build_db_ (r.initialized_ ? r.build_db_ : nullptr), - build_conf_ (r.initialized_ ? r.build_conf_ : nullptr) + build_conf_ (r.initialized_ ? r.build_conf_ : nullptr), + build_conf_names_ (r.initialized_ ? r.build_conf_names_ : nullptr), + build_conf_map_ (r.initialized_ ? r.build_conf_map_ : nullptr) { } @@ -64,6 +67,23 @@ namespace brep throw_generic_error (EIO, os.str ().c_str ()); } + cstrings conf_names; + + using conf_map_type = map; + conf_map_type conf_map; + + for (const auto& c: *build_conf_) + { + const char* cn (c.name.c_str ()); + conf_map[cn] = &c; + conf_names.push_back (cn); + } + + build_conf_names_ = make_shared (move (conf_names)); + build_conf_map_ = make_shared (move (conf_map)); + build_db_ = shared_database (dbo.build_db_user (), dbo.build_db_password (), dbo.build_db_name (), -- cgit v1.1