aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/dist/init.cxx12
-rw-r--r--build2/version/init.cxx10
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.
//