aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-build-force.cxx
diff options
context:
space:
mode:
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 "