diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-06-16 09:43:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-06-16 09:44:17 +0200 |
commit | 856c55d0f8c50d0f371a546e4231e0f415975690 (patch) | |
tree | 4ac34fa8b4db45a3391f368ea7a6f1cc3a0ec481 /bpkg/pkg-build.cxx | |
parent | 7f3273acb395c398869e0948150aaa8c30abcd1e (diff) |
Initial support for negotiation with system dependencies
Diffstat (limited to 'bpkg/pkg-build.cxx')
-rw-r--r-- | bpkg/pkg-build.cxx | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx index 318ce91..a8976ad 100644 --- a/bpkg/pkg-build.cxx +++ b/bpkg/pkg-build.cxx @@ -1060,23 +1060,41 @@ namespace bpkg init_skeleton (const common_options& options, const shared_ptr<available_package>& override = nullptr) { - const shared_ptr<available_package>& ap (override != nullptr - ? override - : available); + shared_ptr<available_package> ap (override != nullptr + ? override + : available); assert (!skeleton && ap != nullptr); - optional<dir_path> src_root (external_dir ()); + package_key pk (db, ap->id.name); - optional<dir_path> out_root ( - src_root && !disfigure - ? dir_path (db.get ().config) /= name ().string () - : optional<dir_path> ()); + if (system) + { + // @@ TODO + // + // Keep the available package if its version is "close enough" to the + // system package version. For now we will require the exact match + // but in the future we could relax this (e.g., allow the user to + // specify something like libfoo/^1.2.0 or some such). + // + ap = nullptr; + } + + optional<dir_path> src_root, out_root; + + if (ap != nullptr) + { + src_root = external_dir (); + out_root = (src_root && !disfigure + ? dir_path (db.get ().config) /= name ().string () + : optional<dir_path> ()); + } skeleton = package_skeleton ( options, - db, - ap, + move (pk), + system, + move (ap), config_vars, // @@ Maybe make optional<strings> and move? disfigure, (selected != nullptr ? &selected->config_variables : nullptr), @@ -4620,7 +4638,9 @@ namespace bpkg const package_configuration& pc ( cfg.dependency_configurations[p]); - pair<bool, string> pr (b->skeleton->verify_sensible (pc)); + pair<bool, string> pr (b->skeleton->available != nullptr + ? b->skeleton->verify_sensible (pc) + : make_pair (true, string ())); if (!pr.first) { @@ -5961,7 +5981,12 @@ namespace bpkg const package_configuration& pc ( pcfg->dependency_configurations[p]); - pair<bool, string> pr (b->skeleton->verify_sensible (pc)); + // Skip the verification if this is a system package + // without skeleton info. + // + pair<bool, string> pr (b->skeleton->available != nullptr + ? b->skeleton->verify_sensible (pc) + : make_pair (true, string ())); if (!pr.first) { |