aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-build-force.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-05-19 19:39:21 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-05-19 19:39:21 +0300
commitc51ccc69ed4039fac8ebfbd7c2fcaf0abb8341d0 (patch)
tree66588196d841fb8174122c1ee61450ec5b4f841b /mod/mod-build-force.cxx
parent90a6531951546ae88a695410013b908b50cd6fd0 (diff)
Allow to enforce rebuild for building state
Diffstat (limited to 'mod/mod-build-force.cxx')
-rw-r--r--mod/mod-build-force.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/mod/mod-build-force.cxx b/mod/mod-build-force.cxx
index 9389566..c0c3d2d 100644
--- a/mod/mod-build-force.cxx
+++ b/mod/mod-build-force.cxx
@@ -169,12 +169,17 @@ handle (request& rq, response& rs)
// Respond with 409 (conflict) if the package configuration is in
// inappropriate state for being rebuilt.
//
- else if (b->state != build_state::built)
+ else if (b->state != build_state::built &&
+ b->state != build_state::building)
throw invalid_request (409, "state is " + to_string (b->state));
- if (!b->forced)
+ force_state force (b->state == build_state::built
+ ? force_state::forced
+ : force_state::forcing);
+
+ if (b->force != force)
{
- b->forced = true;
+ b->force = force;
build_db_->update (b);
l1 ([&]{trace << "force rebuild for "