From c51ccc69ed4039fac8ebfbd7c2fcaf0abb8341d0 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 19 May 2017 19:39:21 +0300 Subject: Allow to enforce rebuild for building state --- mod/mod-build-force.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'mod/mod-build-force.cxx') 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 " -- cgit v1.1