From 0e6d08495733ed268e1624ca6450a0f4ecccac33 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 22 Apr 2017 01:30:16 +0300 Subject: Add support for forced rebuild --- mod/mod-repository-root.cxx | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'mod/mod-repository-root.cxx') diff --git a/mod/mod-repository-root.cxx b/mod/mod-repository-root.cxx index e156308..d8d7c64 100644 --- a/mod/mod-repository-root.cxx +++ b/mod/mod-repository-root.cxx @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,7 @@ namespace brep repository_details_ (make_shared ()), build_task_ (make_shared ()), build_result_ (make_shared ()), + build_force_ (make_shared ()), build_log_ (make_shared ()) { } @@ -97,6 +99,10 @@ namespace brep r.initialized_ ? r.build_result_ : make_shared (*r.build_result_)), + build_force_ ( + r.initialized_ + ? r.build_force_ + : make_shared (*r.build_force_)), build_log_ ( r.initialized_ ? r.build_log_ @@ -121,6 +127,7 @@ namespace brep append (r, repository_details_->options ()); append (r, build_task_->options ()); append (r, build_result_->options ()); + append (r, build_force_->options ()); append (r, build_log_->options ()); return r; } @@ -161,6 +168,7 @@ namespace brep sub_init (*repository_details_, "repository_details"); sub_init (*build_task_, "build_task"); sub_init (*build_result_, "build_result"); + sub_init (*build_force_, "build_force"); sub_init (*build_log_, "build_log"); // Parse own configuration options. @@ -235,10 +243,10 @@ namespace brep // if (lpath.empty ()) { - // Dispatch request handling to the repository_details, the build_task, - // the build_result or the package_search module depending on the - // function name passed as a first HTTP request parameter. The parameter - // should have no value specified. Example: cppget.org/?about + // Dispatch request handling to the repository_details, the + // package_search or the one of build_* modules depending on the function + // name passed as a first HTTP request parameter. The parameter should + // have no value specified. Example: cppget.org/?about // const name_values& params (rq.parameters ()); if (!params.empty () && !params.front ().value) @@ -273,6 +281,13 @@ namespace brep return handle (rp, "build_result"); } + else if (fn == "build-force") + { + if (handler_ == nullptr) + handler_.reset (new build_force (*build_force_)); + + return handle (rp, "build_force"); + } else throw invalid_request (400, "unknown function"); } -- cgit v1.1