aboutsummaryrefslogtreecommitdiff
path: root/build2/dist/operation.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-02-07 15:48:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-07 16:52:55 +0200
commit968d8a7acd6c23078a3ea6936c03be0b45523227 (patch)
treed7da843d0961b649ff93f6f299b9ce65b1255003 /build2/dist/operation.cxx
parent378b2598a305d4e332e52460ca89dd867546a58b (diff)
Add support for update-for-{test,install} operation aliases
Diffstat (limited to 'build2/dist/operation.cxx')
-rw-r--r--build2/dist/operation.cxx32
1 files changed, 22 insertions, 10 deletions
diff --git a/build2/dist/operation.cxx b/build2/dist/operation.cxx
index a378b5d..e0d1f60 100644
--- a/build2/dist/operation.cxx
+++ b/build2/dist/operation.cxx
@@ -126,15 +126,25 @@ namespace build2
{
if (const operation_info* oif = rs->operations[id])
{
+ // Skip aliases (e.g., update-for-install). In fact, one can argue
+ // the default update should be sufficient since it is assumed to
+ // update all prerequisites and we not longer support ad hoc stuff
+ // like test.input.
+ //
+ if (oif->id != id)
+ continue;
+
// Use standard (perform) match.
//
if (oif->pre != nullptr)
{
- const operation_info* poif (
- rs->operations[oif->pre (params, dist_id, loc)]);
- set_current_oif (*poif, oif);
- action a (dist_id, poif->id, oif->id);
- match (params, a, ts, true /* quiet */);
+ if (operation_id pid = oif->pre (params, dist_id, loc))
+ {
+ const operation_info* poif (rs->operations[pid]);
+ set_current_oif (*poif, oif);
+ action a (dist_id, poif->id, oif->id);
+ match (params, a, ts, true /* quiet */);
+ }
}
set_current_oif (*oif);
@@ -143,11 +153,13 @@ namespace build2
if (oif->post != nullptr)
{
- const operation_info* poif (
- rs->operations[oif->post (params, dist_id)]);
- set_current_oif (*poif, oif);
- action a (dist_id, poif->id, oif->id);
- match (params, a, ts, true /* quiet */);
+ if (operation_id pid = oif->post (params, dist_id))
+ {
+ const operation_info* poif (rs->operations[pid]);
+ set_current_oif (*poif, oif);
+ action a (dist_id, poif->id, oif->id);
+ match (params, a, ts, true /* quiet */);
+ }
}
}
}