aboutsummaryrefslogtreecommitdiff
path: root/build2/install/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-06-09 17:54:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-06-09 17:54:31 +0200
commite6f8658c72ad837e3cbd0df9b31ace9686c59048 (patch)
treefa4b72d33488c267f0fdcda36771e9316b45b2d2 /build2/install/rule.cxx
parent1898c3d67ef4cc5e7ec466aab4ca41ce32ad2f0d (diff)
Handle fsdir{} prerequsites during installation
Diffstat (limited to 'build2/install/rule.cxx')
-rw-r--r--build2/install/rule.cxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx
index df25021..1867134 100644
--- a/build2/install/rule.cxx
+++ b/build2/install/rule.cxx
@@ -125,6 +125,41 @@ namespace build2
return default_recipe;
}
+ // fsdir_rule
+ //
+ const fsdir_rule fsdir_rule::instance;
+
+ bool fsdir_rule::
+ match (action, target&, const string&) const
+ {
+ // We always match.
+ //
+ // Note that we are called both as the outer part during the update-for-
+ // un/install pre-operation and as the inner part during the un/install
+ // operation itself.
+ //
+ return true;
+ }
+
+ recipe fsdir_rule::
+ apply (action a, target& t) const
+ {
+ // If this is outer part of the update-for-un/install, delegate to the
+ // default fsdir rule. Otherwise, this is a noop (we don't install
+ // fsdir{}).
+ //
+ // For now we also assume we don't need to do anything for prerequisites
+ // (the only sensible prerequisite of fsdir{} is another fsdir{}).
+ //
+ if (a.operation () == update_id)
+ {
+ match_inner (a, t);
+ return &execute_inner;
+ }
+ else
+ return noop_recipe;
+ }
+
// group_rule
//
const group_rule group_rule::instance (false /* see_through_only */);