From 70acb4044c01c53126fb8d301716cdb0292a40e2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Jun 2022 10:31:45 +0200 Subject: Print configuration in build plan --- bpkg/pkg-build.cxx | 29 ++++++++++++++++++++++++++--- 1 file 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 #include // numeric_limits #include // strlen() +#include #include // cout #include // ref() #include @@ -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& 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 src_root (p.external_dir ()); optional out_root ( @@ -12893,6 +12911,8 @@ namespace bpkg // shared_ptr dap (find_available (o, pdb, sp)); + // @@ TODO: factor to init_skeleton. + optional src_root (p.external_dir ()); optional 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, -- cgit v1.1