aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-06-13 10:31:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-06-13 10:31:45 +0200
commit70acb4044c01c53126fb8d301716cdb0292a40e2 (patch)
tree3f3ea2b0f7dadb195a27d1cbd535f1092b3ce1b3
parent9c910b941a3aab201a5964c0b3272c4b630115c0 (diff)
Print configuration in build plan
-rw-r--r--bpkg/pkg-build.cxx29
1 files changed, 26 insertions, 3 deletions
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index 72b8b7a..0acab14 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -8,6 +8,7 @@
#include <list>
#include <limits> // numeric_limits
#include <cstring> // strlen()
+#include <sstream>
#include <iostream> // cout
#include <functional> // ref()
#include <forward_list>
@@ -12030,15 +12031,15 @@ namespace bpkg
{
bool first (true); // First entry in the plan.
- for (const build_package& p: reverse_iterate (pkgs))
+ for (build_package& p: reverse_iterate (pkgs))
{
+ assert (p.action);
+
database& pdb (p.db);
const shared_ptr<selected_package>& sp (p.selected);
string act;
- assert (p.action);
-
if (*p.action == build_package::drop)
{
act = "drop " + sp->string (pdb) + " (unused)";
@@ -12046,6 +12047,13 @@ namespace bpkg
}
else
{
+ package_skeleton* cfg (nullptr); // Print configuration variables.
+
+ // @@ TODO set cfg
+ //
+ // @@ Maybe use pointer to skeleton as indication since it will have
+ // to be init'ed differently in different situations.
+
string cause;
if (*p.action == build_package::adjust)
{
@@ -12154,6 +12162,14 @@ namespace bpkg
if (!rb.empty ())
act += " (" + cause + rb + ')';
+
+ if (cfg != nullptr && !cfg->empty ())
+ {
+ ostringstream os;
+ cfg->print_config (os, o.print_only () ? " " : " ");
+ act += '\n';
+ act += os.string ();
+ }
}
if (first)
@@ -12855,6 +12871,8 @@ namespace bpkg
{
assert (sp != nullptr && !p.skeleton); // See above.
+ // @@ TODO: factor to init_skeleton.
+
optional<dir_path> src_root (p.external_dir ());
optional<dir_path> out_root (
@@ -12893,6 +12911,8 @@ namespace bpkg
//
shared_ptr<available_package> dap (find_available (o, pdb, sp));
+ // @@ TODO: factor to init_skeleton.
+
optional<dir_path> src_root (p.external_dir ());
optional<dir_path> out_root (
@@ -12905,6 +12925,9 @@ namespace bpkg
// build, which can be quite surprising. Should we store this
// information in the database?
//
+ // I believe this now works for external packages via package
+ // skeleton (wich extracts user configruation).
+ //
pkg_configure (o,
pdb,
t,