diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-07-03 11:46:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-07-03 11:46:16 +0200 |
commit | e8ab7c08f14f8424ef26100ca28586d9f18bc52a (patch) | |
tree | 986f349e0eca9d062fae8a831bef18210fce97fb | |
parent | 50e1ffc8f9c48e3e81bd5fa38381193942182df3 (diff) |
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).
-rw-r--r-- | build2/dist/init.cxx | 12 | ||||
-rw-r--r-- | 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<paths> ("config.dist.archives", true); vp.insert<path> ("config.dist.cmd", true); + // Allow distribution of uncommitted projects. This is enforced by the + // version module. + // + vp.insert<bool> ("config.dist.uncommitted", true); + vp.insert<dir_path> ("dist.root"); vp.insert<process_path> ("dist.cmd"); vp.insert<paths> ("dist.archives"); + vp.insert<paths> ("dist.uncommitted"); vp.insert<bool> ("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<bool> (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<bool> ("config.dist.uncommitted", true)); - m.dist_uncommitted = cast_false<bool> (config::optional (rs, var)); - } + m.dist_uncommitted = cast_false<bool> (rs["config.dist.uncommitted"]); // Don't touch if dist.package was set by the user. // |