aboutsummaryrefslogtreecommitdiff
path: root/build2/dist
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-13 14:20:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-13 14:22:07 +0200
commitf11d720f2fb62b46ad17d3aa3850140a4839f114 (patch)
tree7b077efc16b0362283e1857cf974090ee4ce8f26 /build2/dist
parent08688bfc12a42a0399bcbdd6fe7d30d8f2486775 (diff)
Implement info meta operation
This meta operation can be used to print basic information (name, version, source/output roots, etc) for one or more projects.
Diffstat (limited to 'build2/dist')
-rw-r--r--build2/dist/init.cxx2
-rw-r--r--build2/dist/operation.cxx34
-rw-r--r--build2/dist/operation.hxx2
3 files changed, 16 insertions, 22 deletions
diff --git a/build2/dist/init.cxx b/build2/dist/init.cxx
index d002868..33ddcd7 100644
--- a/build2/dist/init.cxx
+++ b/build2/dist/init.cxx
@@ -32,7 +32,7 @@ namespace build2
// Register meta-operation.
//
- rs.meta_operations.insert (dist_id, dist);
+ rs.meta_operations.insert (dist_id, mo_dist);
// Enter module variables. Do it during boot in case they get assigned
// in bootstrap.build (which is customary for, e.g., dist.package).
diff --git a/build2/dist/operation.cxx b/build2/dist/operation.cxx
index 6692156..d63e483 100644
--- a/build2/dist/operation.cxx
+++ b/build2/dist/operation.cxx
@@ -54,12 +54,6 @@ namespace build2
}
static void
- dist_match (const values&, action, action_targets&)
- {
- // Don't match anything -- see execute ().
- }
-
- static void
dist_execute (const values&, action, action_targets& ts, bool)
{
tracer trace ("dist_execute");
@@ -249,8 +243,8 @@ namespace build2
// Make sure what we need to distribute is up to date.
//
{
- if (perform.meta_operation_pre != nullptr)
- perform.meta_operation_pre (params, loc);
+ if (mo_perform.meta_operation_pre != nullptr)
+ mo_perform.meta_operation_pre (params, loc);
// This is a hack since according to the rules we need to completely
// reset the state. We could have done that (i.e., saved target names
@@ -259,24 +253,24 @@ namespace build2
// the dist mete-opreation is "compatible" with perform).
//
size_t on (current_on);
- set_current_mif (perform);
+ set_current_mif (mo_perform);
current_on = on + 1;
- if (perform.operation_pre != nullptr)
- perform.operation_pre (params, update_id);
+ if (mo_perform.operation_pre != nullptr)
+ mo_perform.operation_pre (params, update_id);
- set_current_oif (update);
+ set_current_oif (op_update);
action a (perform_id, update_id);
- perform.match (params, a, files);
- perform.execute (params, a, files, true); // Run quiet.
+ mo_perform.match (params, a, files);
+ mo_perform.execute (params, a, files, true); // Run quiet.
- if (perform.operation_post != nullptr)
- perform.operation_post (params, update_id);
+ if (mo_perform.operation_post != nullptr)
+ mo_perform.operation_post (params, update_id);
- if (perform.meta_operation_post != nullptr)
- perform.meta_operation_post (params);
+ if (mo_perform.meta_operation_post != nullptr)
+ mo_perform.meta_operation_post (params);
}
dir_path td (dist_root / dir_path (dist_package));
@@ -525,7 +519,7 @@ namespace build2
}
}
- const meta_operation_info dist {
+ const meta_operation_info mo_dist {
dist_id,
"dist",
"distribute",
@@ -536,7 +530,7 @@ namespace build2
&dist_operation_pre,
&load, // normal load
&search, // normal search
- &dist_match,
+ nullptr, // no match (see execute()).
&dist_execute,
nullptr, // operation post
nullptr // meta-operation post
diff --git a/build2/dist/operation.hxx b/build2/dist/operation.hxx
index c72e467..0639688 100644
--- a/build2/dist/operation.hxx
+++ b/build2/dist/operation.hxx
@@ -14,7 +14,7 @@ namespace build2
{
namespace dist
{
- extern const meta_operation_info dist;
+ extern const meta_operation_info mo_dist;
}
}