From 4a5ca6f9853938eec8b5e487dc6cb3728dfb6a15 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 22 Dec 2021 21:52:01 +0300 Subject: Adapt to package manifest dependency classes change --- load/load.cxx | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'load') diff --git a/load/load.cxx b/load/load.cxx index 34e59a7..ad5379e 100644 --- a/load/load.cxx +++ b/load/load.cxx @@ -499,43 +499,41 @@ load_packages (const shared_ptr& rp, for (auto& das: pm.dependencies) { - // Ignore special build2 and bpkg dependencies. We may not have - // packages for them and also showing them for every package is - // probably not very helpful. - // - if (das.buildtime && !das.empty ()) - { - const auto& da (das.front ()); - - assert (da.size () == 1); // @@ DEP - - const package_name& n (da[0].name); - if (n == "build2" || n == "bpkg") - continue; - } - - tds.emplace_back (das.conditional, - das.buildtime, - move (das.comment)); - - dependency_alternatives& tdas (tds.back ()); + dependency_alternatives tdas (das.buildtime, move (das.comment)); for (auto& da: das) { - tdas.push_back (dependency_alternative (move (da.enable))); - dependency_alternative& tda (tdas.back ()); + dependency_alternative tda (move (da.enable), + move (da.reflect), + move (da.prefer), + move (da.accept), + move (da.require)); for (auto& d: da) { + package_name& n (d.name); + + // Ignore special build2 and bpkg dependencies. We may not have + // packages for them and also showing them for every package is + // probably not very helpful. + // + if (das.buildtime && (n == "build2" || n == "bpkg")) + continue; + // The package member will be assigned during dependency // resolution procedure. // - tda.push_back ( - dependency {move (d.name), - move (d.constraint), - nullptr /* package */}); + tda.push_back (dependency {move (n), + move (d.constraint), + nullptr /* package */}); } + + if (!tda.empty ()) + tdas.push_back (move (tda)); } + + if (!tdas.empty ()) + tds.push_back (move (tdas)); } small_vector ts; -- cgit v1.1