From 0342dc2fcdd78ef28a4e59d84193a3807068d726 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Apr 2016 07:57:19 +0200 Subject: New configuration logic, iteration 1 --- build2/dist/module | 4 ++-- build2/dist/module.cxx | 30 ++++++++++++++---------------- build2/dist/operation.cxx | 9 +++++---- 3 files changed, 21 insertions(+), 22 deletions(-) (limited to 'build2/dist') diff --git a/build2/dist/module b/build2/dist/module index 829f3f7..61e44c3 100644 --- a/build2/dist/module +++ b/build2/dist/module @@ -15,11 +15,11 @@ namespace build2 namespace dist { extern "C" void - dist_boot (scope&, const location&, unique_ptr&); + dist_boot (scope&, const location&, unique_ptr&); extern "C" bool dist_init ( - scope&, scope&, const location&, unique_ptr&, bool, bool); + scope&, scope&, const location&, unique_ptr&, bool, bool); } } diff --git a/build2/dist/module.cxx b/build2/dist/module.cxx index 4b68bb8..2a7ba92 100644 --- a/build2/dist/module.cxx +++ b/build2/dist/module.cxx @@ -23,7 +23,7 @@ namespace build2 static rule rule_; extern "C" void - dist_boot (scope& r, const location&, unique_ptr&) + dist_boot (scope& r, const location&, unique_ptr&) { tracer trace ("dist::boot"); @@ -39,20 +39,18 @@ namespace build2 { auto& v (var_pool); - // @@ OVR + // Note: some overridable, some not. + // + v.insert ("config.dist.root", true); + v.insert ("config.dist.archives", true); + v.insert ("config.dist.cmd", true); - v.insert ("dist"); + v.insert ("dist.root"); + v.insert ("dist.cmd"); + v.insert ("dist.archives"); - v.insert ("dist.package"); - - v.insert ("dist.root"); - v.insert ("config.dist.root"); - - v.insert ("dist.cmd"); - v.insert ("config.dist.cmd"); - - v.insert ("dist.archives"); - v.insert ("config.dist.archives"); + v.insert ("dist"); // Flag. + v.insert ("dist.package"); // Project's package name. } } @@ -60,7 +58,7 @@ namespace build2 dist_init (scope& r, scope&, const location& l, - unique_ptr&, + unique_ptr&, bool first, bool) { @@ -97,10 +95,10 @@ namespace build2 if (s) { - const value& cv (config::optional_absolute (r, "config.dist.root")); + const value& cv (config::optional (r, "config.dist.root")); if (cv && !cv.empty ()) - v = cv; + v = cast (cv); // Strip abs_dir_path. } } diff --git a/build2/dist/operation.cxx b/build2/dist/operation.cxx index 8a890fa..9ae5773 100644 --- a/build2/dist/operation.cxx +++ b/build2/dist/operation.cxx @@ -72,7 +72,7 @@ namespace build2 // Make sure we have the necessary configuration before // we get down to business. // - auto l (rs->vars["dist.root"]); //@@ OVR + auto l (rs->vars["dist.root"]); if (!l || l->empty ()) fail << "unknown root distribution directory" << @@ -84,14 +84,14 @@ namespace build2 fail << "root distribution directory " << dist_root << " does not exist"; - l = rs->vars["dist.package"]; //@@ OVR + l = rs->vars["dist.package"]; if (!l || l->empty ()) fail << "unknown distribution package name" << info << "did you forget to set dist.package?"; const string& dist_package (cast (l)); - const path& dist_cmd (cast (rs->vars["dist.cmd"])); // @@ OVR + const path& dist_cmd (cast (rs->vars["dist.cmd"])); // Get the list of operations supported by this project. Skip // default_id. @@ -281,7 +281,7 @@ namespace build2 // Archive if requested. // - if (auto l = rs->vars["dist.archives"]) // @@ OVR + if (auto l = rs->vars["dist.archives"]) { for (const string& e: cast (l)) archive (dist_root, dist_package, e); @@ -425,6 +425,7 @@ namespace build2 } meta_operation_info dist { + dist_id, "dist", "distribute", "distributing", -- cgit v1.1