From 45ee1a71a27a938db9ffe7218f3a19b585de63b4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Oct 2021 07:37:28 +0200 Subject: Minor install-related cleanups --- libbuild2/install/rule.cxx | 11 +++++++++-- libbuild2/install/rule.hxx | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'libbuild2/install') 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 (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&); -- cgit v1.1