aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-08 08:12:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-08 08:12:54 +0200
commit8e42d1ec329ac16ec5ae9692f18cdb0f2444d2fb (patch)
tree386ea3472fa382727d1f377c0c7090f81ddd292a /libbuild2/rule.cxx
parentfb56fc798110c8ee9685bec156b21f1f87aca121 (diff)
Fix handling of inner/outer operations in ad hoc recipes machinery
Diffstat (limited to 'libbuild2/rule.cxx')
-rw-r--r--libbuild2/rule.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/libbuild2/rule.cxx b/libbuild2/rule.cxx
index fb769fd..f257b62 100644
--- a/libbuild2/rule.cxx
+++ b/libbuild2/rule.cxx
@@ -472,12 +472,24 @@ namespace build2
recipe adhoc_script_rule::
apply (action a, target& t) const
{
+ // If this is an outer operation (e.g., update-for-test), then delegate to
+ // the inner.
+ //
+ if (a.outer ())
+ {
+ match_inner (a, t);
+ return execute_inner;
+ }
+
// Derive file names for the target and its ad hoc group members, if any.
//
- for (target* m (&t); m != nullptr; m = m->adhoc_member)
+ if (a == perform_update_id || a == perform_clean_id)
{
- if (auto* p = m->is_a<path_target> ())
- p->derive_path ();
+ for (target* m (&t); m != nullptr; m = m->adhoc_member)
+ {
+ if (auto* p = m->is_a<path_target> ())
+ p->derive_path ();
+ }
}
// Inject dependency on the output directory.