diff options
Diffstat (limited to 'libbuild2/install/operation.hxx')
-rw-r--r-- | libbuild2/install/operation.hxx | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/libbuild2/install/operation.hxx b/libbuild2/install/operation.hxx index 4983976..d71d8f3 100644 --- a/libbuild2/install/operation.hxx +++ b/libbuild2/install/operation.hxx @@ -4,15 +4,15 @@ #ifndef LIBBUILD2_INSTALL_OPERATION_HXX #define LIBBUILD2_INSTALL_OPERATION_HXX -#include <libbuild2/types.hxx> -#include <libbuild2/utility.hxx> - #ifndef BUILD2_BOOTSTRAP # include <libbutl/json/serializer.hxx> #endif +#include <libbuild2/types.hxx> +#include <libbuild2/utility.hxx> + #include <libbuild2/operation.hxx> -#include <libbuild2/filesystem.hxx> // auto_rmfile +#include <libbuild2/filesystem.hxx> // auto_rmfile, entry_type namespace build2 { @@ -22,10 +22,27 @@ namespace build2 extern const operation_info op_uninstall; extern const operation_info op_update_for_install; - // Set as context::current_inner_odata during the install inner operation. + using filters = vector<pair<string, string>>; + + // Set as context::current_inner_odata during the install/uninstall inner + // operations. // - struct install_context_data + struct context_data { + // Filters. + // + const install::filters* filters; + + // If entry type is a directory, then leaf must be empty. + // + static bool + filter (const scope& rs, + const dir_path& base, + const path& leaf, + entry_type); + + // Manifest. + // #ifndef BUILD2_BOOTSTRAP path manifest_file; // Absolute and normalized, empty if `-`. path_name manifest_name; // Original path/name. @@ -43,9 +60,6 @@ namespace build2 vector<manifest_target_entry> manifest_target_entries; #endif - explicit - install_context_data (const path* manifest); - // The following manifest_install_[dfl]() functions correspond to (and // are called from) file_rule::install_[dfl](). @@ -74,6 +88,11 @@ namespace build2 const path& link_target, const dir_path& dir, const path& link); + + // Constructor. + // + explicit + context_data (const install::filters*, const path* manifest); }; } } |