aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/install
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-10-07 07:37:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-10-07 07:37:28 +0200
commit45ee1a71a27a938db9ffe7218f3a19b585de63b4 (patch)
treefbdce9cdf036b548a9c7aeb10782d69a8210f558 /libbuild2/install
parent9637eb583a4e2bc028b93d5b8f5ceb981402554d (diff)
Minor install-related cleanups
Diffstat (limited to 'libbuild2/install')
-rw-r--r--libbuild2/install/rule.cxx11
-rw-r--r--libbuild2/install/rule.hxx6
2 files changed, 15 insertions, 2 deletions
diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx
index 3543286..b4b4a01 100644
--- a/libbuild2/install/rule.cxx
+++ b/libbuild2/install/rule.cxx
@@ -298,6 +298,13 @@ namespace build2
recipe file_rule::
apply (action a, target& t) const
{
+ recipe r (apply_impl (a, t));
+ return r != nullptr ? r : noop_recipe;
+ }
+
+ recipe file_rule::
+ apply_impl (action a, target& t) const
+ {
tracer trace ("install::file_rule::apply");
// Note that we are called both as the outer part during the update-for-
@@ -307,10 +314,10 @@ namespace build2
// In both cases we first determine if the target is installable and
// return noop if it's not. Otherwise, in the first case (update-for-
// un/install) we delegate to the normal update and in the second
- // (un/install) -- perform the test.
+ // (un/install) -- perform the install.
//
if (!lookup_install<path> (t, "install"))
- return noop_recipe;
+ return empty_recipe;
// In both cases, the next step is to search, match, and collect all the
// installable prerequisites.
diff --git a/libbuild2/install/rule.hxx b/libbuild2/install/rule.hxx
index 2ed162e..61c0ae9 100644
--- a/libbuild2/install/rule.hxx
+++ b/libbuild2/install/rule.hxx
@@ -133,6 +133,12 @@ namespace build2
virtual recipe
apply (action, target&) const override;
+ // Implementation of apply() that returns empty_recipe if the target is
+ // not installable.
+ //
+ recipe
+ apply_impl (action, target&) const;
+
static target_state
perform_update (action, const target&);