From 098460199c35218979e207a1709111e477ab9567 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Oct 2015 09:13:37 +0200 Subject: build command genesis, some re-factoring --- bpkg/pkg-status.cxx | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'bpkg/pkg-status.cxx') diff --git a/bpkg/pkg-status.cxx b/bpkg/pkg-status.cxx index dbd2bd0..196106a 100644 --- a/bpkg/pkg-status.cxx +++ b/bpkg/pkg-status.cxx @@ -84,45 +84,9 @@ namespace bpkg // Only consider packages that are in repositories that were // explicitly added to the configuration and their complements, - // transitively. While we could maybe come up with a (barely - // comprehensible) view/query to achieve this, doing it on the - // "client side" is definitely more straightforward. + // recursively. // - shared_ptr root (db.load ("")); - - for (shared_ptr ap: - pointer_result (db.query (q))) - { - function&)> find = - [&ap, &find](const shared_ptr& r) -> bool - { - const auto& cs (r->complements); - - for (const package_location& pl: ap->locations) - { - // First check all the complements without loading them. - // - if (cs.find (pl.repository) != cs.end ()) - return true; - - // If not found, then load the complements and check them - // recursively. - // - for (lazy_shared_ptr cr: cs) - { - if (find (cr.load ())) - return true; - } - } - - return false; - }; - - level4 ([&]{trace << "available " << ap->version;}); - - if (find (root)) - aps.push_back (ap); - } + aps = filter (db.load (""), db.query (q)); } t.commit (); -- cgit v1.1