From e8ab7c08f14f8424ef26100ca28586d9f18bc52a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 3 Jul 2018 11:46:16 +0200 Subject: Enter config.dist.uncommitted in dist module, make omitted One side-effect of doing this in the version module (where it is still used and enforced) was that dist module configuration (e.g., in an amalgamation) did not include this variable (and which was then duplicated in each subproject). --- build2/dist/init.cxx | 12 ++++++++++++ build2/version/init.cxx | 10 +--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/build2/dist/init.cxx b/build2/dist/init.cxx index a7d8d2f..df162a2 100644 --- a/build2/dist/init.cxx +++ b/build2/dist/init.cxx @@ -50,9 +50,15 @@ namespace build2 vp.insert ("config.dist.archives", true); vp.insert ("config.dist.cmd", true); + // Allow distribution of uncommitted projects. This is enforced by the + // version module. + // + vp.insert ("config.dist.uncommitted", true); + vp.insert ("dist.root"); vp.insert ("dist.cmd"); vp.insert ("dist.archives"); + vp.insert ("dist.uncommitted"); vp.insert ("dist", variable_visibility::target); // Flag. @@ -148,6 +154,12 @@ namespace build2 } } + // dist.uncommitted + // + // Omit it from the configuration unless specified. + // + config::omitted (rs, "config.dist.uncommitted"); + return true; } } diff --git a/build2/version/init.cxx b/build2/version/init.cxx index d1b0273..dbbb7d9 100644 --- a/build2/version/init.cxx +++ b/build2/version/init.cxx @@ -267,15 +267,7 @@ namespace build2 if (!cast_false (rs["dist.loaded"])) load_module (rs, rs, "dist", l); - // Add the config.dist.uncommitted configuration variable (a bit cozy - // adding other module's config variable but I am not sure calling it - // config.version.dist.uncommitted would be better). - // - auto& vp (var_pool.rw (rs)); - { - const auto& var (vp.insert ("config.dist.uncommitted", true)); - m.dist_uncommitted = cast_false (config::optional (rs, var)); - } + m.dist_uncommitted = cast_false (rs["config.dist.uncommitted"]); // Don't touch if dist.package was set by the user. // -- cgit v1.1