aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-05-19 14:24:18 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-05-19 14:24:18 +0300
commit172625781c1b25a345c64ee922215a9774bf7bd7 (patch)
tree2bf6ad1541a351e2c82ffa8a8a4d88de48c3bc9d
parent817c11416ee6b7fe02cff6c25e80e871c0e770c5 (diff)
Pass config variables sources to skeleton constructor
-rw-r--r--bpkg/package-skeleton.cxx8
-rw-r--r--bpkg/package-skeleton.hxx2
-rw-r--r--bpkg/pkg-build.cxx28
-rw-r--r--bpkg/pkg-configure.cxx5
4 files changed, 30 insertions, 13 deletions
diff --git a/bpkg/package-skeleton.cxx b/bpkg/package-skeleton.cxx
index aa90172..a8d37fe 100644
--- a/bpkg/package-skeleton.cxx
+++ b/bpkg/package-skeleton.cxx
@@ -101,14 +101,14 @@ namespace bpkg
database& db,
const available_package& ap,
strings cvs,
- /*const vector<config_variable>* css,*/ // @@ TMP
+ const vector<config_variable>* css,
optional<dir_path> src_root,
optional<dir_path> out_root)
: co_ (&co),
db_ (&db),
available_ (&ap),
config_vars_ (move (cvs)),
- config_srcs_ (/*css*/ nullptr) // @@ TMP
+ config_srcs_ (css)
{
// Should not be created for stubs.
//
@@ -599,7 +599,9 @@ namespace bpkg
if (!reflect_vars_.empty ())
{
- assert (config_srcs_ == nullptr); // Should have been merged.
+ // @@ TMP Uncomment when the merge is implemented.
+ //
+ //assert (config_srcs_ == nullptr); // Should have been merged.
vars = move (reflect_vars_);
diff --git a/bpkg/package-skeleton.hxx b/bpkg/package-skeleton.hxx
index 3e0da50..6030bdd 100644
--- a/bpkg/package-skeleton.hxx
+++ b/bpkg/package-skeleton.hxx
@@ -54,7 +54,7 @@ namespace bpkg
database&,
const available_package&,
strings config_vars,
- /*const vector<config_variable>* config_srcs,*/ // @@ TMP
+ const vector<config_variable>* config_srcs,
optional<dir_path> src_root,
optional<dir_path> out_root);
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index 1d814b7..4d04f7a 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -2790,6 +2790,9 @@ namespace bpkg
pdb,
*ap,
pkg.config_vars,
+ (sp != nullptr && !pkg.disfigure
+ ? &sp->config_variables
+ : nullptr),
move (src_root),
move (out_root));
}
@@ -5077,12 +5080,14 @@ namespace bpkg
const shared_ptr<available_package>& ap (b->available);
- b->skeleton = package_skeleton (o,
- b->db,
- *ap,
- b->config_vars,
- move (src_root),
- move (out_root));
+ b->skeleton =
+ package_skeleton (o,
+ b->db,
+ *ap,
+ b->config_vars,
+ nullptr /* config_srcs */, // @@ TMP
+ move (src_root),
+ move (out_root));
const auto& pos (ed.dependency_position);
@@ -11413,6 +11418,9 @@ namespace bpkg
pdb,
*ap,
move (p.config_vars),
+ (!p.disfigure
+ ? &sp->config_variables
+ : nullptr),
move (src_root),
move (out_root)),
prereqs (),
@@ -11427,9 +11435,8 @@ namespace bpkg
//
assert (sp->state == package_state::unpacked);
- // Note that we don't use find_available*() here since we don't care
- // about the repository fragment the package comes from and only need
- // its manifest information.
+ // Note that here we don't care about the repository fragment the
+ // package comes from and only need its manifest information.
//
shared_ptr<available_package> dap (find_available (o, pdb, sp));
@@ -11455,6 +11462,9 @@ namespace bpkg
pdb,
*dap,
move (p.config_vars),
+ (!p.disfigure
+ ? &sp->config_variables
+ : nullptr),
move (src_root),
move (out_root)),
prereqs (),
diff --git a/bpkg/pkg-configure.cxx b/bpkg/pkg-configure.cxx
index 49570c2..e2ecacb 100644
--- a/bpkg/pkg-configure.cxx
+++ b/bpkg/pkg-configure.cxx
@@ -591,6 +591,10 @@ namespace bpkg
? dir_path (db.config) /= p->name.string ()
: optional<dir_path> ());
+ // Note that the package could have been disfigured with --keep-config.
+ // Thus, we always pass config variables it may store to the package
+ // skeleton.
+ //
pkg_configure (o,
db,
t,
@@ -601,6 +605,7 @@ namespace bpkg
db,
*ap,
move (vars),
+ &p->config_variables,
move (src_root),
move (out_root)),
nullptr /* prerequisites */,