From 5d513688ae07d96910dd1eef83bdad4e9d780373 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 22 Apr 2021 21:57:13 +0300 Subject: Add support for linked configurations --- bpkg/pkg-configure.hxx | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'bpkg/pkg-configure.hxx') diff --git a/bpkg/pkg-configure.hxx b/bpkg/pkg-configure.hxx index b708df5..6d3a7c9 100644 --- a/bpkg/pkg-configure.hxx +++ b/bpkg/pkg-configure.hxx @@ -20,35 +20,53 @@ namespace bpkg int pkg_configure (const pkg_configure_options&, cli::scanner& args); + // The custom search function. If specified, it is called by pkg_configure() + // and pkg_configure_prerequisites() to obtain the database to search for + // the prerequisite in, instead of searching for it in the linked databases, + // recursively. If the function returns NULL, then fallback to the recursive + // search through the linked databases. + // + using find_database_function = database* (database&, + const package_name&, + bool buildtime); + // Note: all of the following functions expect the package dependency // constraints to be complete. // Configure the package, update its state, and commit the transaction. // void - pkg_configure (const dir_path& configuration, - const common_options&, + pkg_configure (const common_options&, + database&, transaction&, const shared_ptr&, const dependencies&, const strings& config_vars, - bool simulate); + bool simulate, + const function& = {}); // Configure a system package and commit the transaction. // shared_ptr - pkg_configure_system (const package_name&, const version&, transaction&); + pkg_configure_system (const package_name&, + const version&, + database&, + transaction&); // Return package prerequisites given its dependencies. Fail if some of the // prerequisites are not configured or don't satisfy the package's // dependency constraints. Note that the package argument is used for // diagnostics only. // + // Note: loads selected packages. + // package_prerequisites pkg_configure_prerequisites (const common_options&, + database&, transaction&, const dependencies&, - const package_name&); + const package_name&, + const function& = {}); } #endif // BPKG_PKG_CONFIGURE_HXX -- cgit v1.1