aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-build-task.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-05-14 00:37:16 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-05-15 20:37:43 +0300
commit5163436b00711318baea4fc0ad43a4de8222354a (patch)
treea05c06693bda84dd9a9b365a50c227126a5ec05f /mod/mod-build-task.cxx
parent2ebf9de408f3fd629126a20b21221e186195813c (diff)
Implement builds page
Diffstat (limited to 'mod/mod-build-task.cxx')
-rw-r--r--mod/mod-build-task.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/mod/mod-build-task.cxx b/mod/mod-build-task.cxx
index d75c73d..3e02463 100644
--- a/mod/mod-build-task.cxx
+++ b/mod/mod-build-task.cxx
@@ -7,6 +7,10 @@
#include <map>
#include <chrono>
+#include <odb/database.hxx>
+#include <odb/transaction.hxx>
+#include <odb/schema-catalog.hxx>
+
#include <libbutl/utility.hxx> // compare_c_string
#include <libbutl/filesystem.hxx> // path_match()
#include <libbutl/manifest-parser.hxx>
@@ -15,9 +19,6 @@
#include <libbbot/manifest.hxx>
#include <libbbot/build-config.hxx>
-#include <odb/database.hxx>
-#include <odb/transaction.hxx>
-
#include <web/module.hxx>
#include <libbrep/build.hxx>
@@ -56,10 +57,22 @@ init (scanner& s)
options_->package_db_retry ());
if (options_->build_config_specified ())
+ {
database_module::init (static_cast<options::build> (*options_),
static_cast<options::build_db> (*options_),
options_->build_db_retry ());
+ // Check that the database 'build' schema matches the current one. It's
+ // enough to perform the check in just a single module implementation
+ // (more details in the comment in package_search::init()).
+ //
+ const string ds ("build");
+ if (schema_catalog::current_version (*build_db_, ds) !=
+ build_db_->schema_version (ds))
+ fail << "database 'build' schema differs from the current one (module "
+ << BREP_VERSION_ID << ")";
+ }
+
if (options_->root ().empty ())
options_->root (dir_path ("/"));
}