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 --- libbrep/build.hxx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'libbrep/build.hxx') diff --git a/libbrep/build.hxx b/libbrep/build.hxx index 9258bb3..afa96ed 100644 --- a/libbrep/build.hxx +++ b/libbrep/build.hxx @@ -82,6 +82,28 @@ namespace brep to(to_string (?)) \ from(brep::to_build_state (?)) + // force_state + // + enum class force_state: std::uint8_t + { + unforced, + forcing, // Rebuild is forced while being in the building state. + forced // Rebuild is forced while being in the built state. + }; + + string + to_string (force_state); + + force_state + to_force_state (const string&); // May throw invalid_argument. + + inline ostream& + operator<< (ostream& os, force_state s) {return os << to_string (s);} + + #pragma db map type(force_state) as(string) \ + to(to_string (?)) \ + from(brep::to_force_state (?)) + // result_status // using bbot::result_status; @@ -118,7 +140,7 @@ namespace brep using timestamp_type = brep::timestamp; // Create the build object with the building state, non-existent status, - // the timestamp set to now and the forced flag set to false. + // the timestamp set to now and the force state set to unforced. // build (string package_name, version package_version, string configuration, @@ -140,9 +162,7 @@ namespace brep // timestamp_type timestamp; - // True if the package rebuild has been forced. - // - bool forced; + force_state force; // Must present for the built state, may present for the building state. // -- cgit v1.1