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-command.hxx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'bpkg/pkg-command.hxx') diff --git a/bpkg/pkg-command.hxx b/bpkg/pkg-command.hxx index 40a55f2..0ed7072 100644 --- a/bpkg/pkg-command.hxx +++ b/bpkg/pkg-command.hxx @@ -20,6 +20,8 @@ namespace bpkg // The command can also be performed recursively for all or immediate // dependencies of the specified or all the held packages. // + // Note: loads selected packages. + // int pkg_command (const string& cmd, // Without the 'pkg-' prefix. const configuration_options&, @@ -33,15 +35,34 @@ namespace bpkg struct pkg_command_vars { + // Configuration information. + // + // Used to derive the package out_root directory, issue diagnostics, etc. + // + // Note that we cannot store the database reference here since it can be + // closed by the time this information is used. Instead, we save the + // required information. + // + dir_path config_orig; // Database's config_orig. + bool config_main; // True if database is main. + shared_ptr pkg; - strings vars; // Package-specific command line vars. + strings vars; // Package-specific command line vars. bool cwd; // Change the working directory to the package directory. + + // Return the selected package name/version followed by the configuration + // directory, unless this is the current configuration. For example: + // + // libfoo/1.1.0 + // libfoo/1.1.0 [cfg/] + // + std::string + string () const; }; void pkg_command (const string& cmd, - const dir_path& configuration, const common_options&, const string& cmd_variant, const strings& common_vars, -- cgit v1.1