From 4947e501153d457ce25a49d8cc3c82b4be307b1a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 19 May 2018 11:16:00 +0200 Subject: Add lower-level pre/post installation hooks to install::file_rule --- build2/install/rule.hxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'build2/install/rule.hxx') diff --git a/build2/install/rule.hxx b/build2/install/rule.hxx index 2ad3d4b..c84249e 100644 --- a/build2/install/rule.hxx +++ b/build2/install/rule.hxx @@ -11,6 +11,7 @@ #include #include #include +#include namespace build2 { @@ -108,7 +109,7 @@ namespace build2 static target_state perform_update (action, const target&); - // Extra un/installation hooks. Return true if anything was + // Extra un/installation hooks. Return true if anything was actually // un/installed. // using install_dir = install::install_dir; // For derived rules. @@ -119,6 +120,19 @@ namespace build2 virtual bool uninstall_extra (const file&, const install_dir&) const; + // Lower-level pre/post installation hooks that can be used to override + // the source file path being installed (for example, to implement + // post-processing, etc). + // + // Note that one cannot generally perform post-processing in-place + // because of permissions. + // + virtual auto_rmfile + install_pre (const file&, const install_dir&) const; + + virtual bool + install_post (const file&, const install_dir&, auto_rmfile&&) const; + // Installation/uninstallation "commands". // // If verbose is false, then only print the command at verbosity level 2 -- cgit v1.1