aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-status.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-10-01 09:13:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-10-01 09:13:37 +0200
commit098460199c35218979e207a1709111e477ab9567 (patch)
tree55765e91a517759bf28672abeda96102f2f511c4 /bpkg/pkg-status.cxx
parent42bbdd0e7f0d78b622697bf4d4543c1aead22ae8 (diff)
build command genesis, some re-factoring
Diffstat (limited to 'bpkg/pkg-status.cxx')
-rw-r--r--bpkg/pkg-status.cxx40
1 files changed, 2 insertions, 38 deletions
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<repository> root (db.load<repository> (""));
-
- for (shared_ptr<available_package> ap:
- pointer_result (db.query<available_package> (q)))
- {
- function<bool (const shared_ptr<repository>&)> find =
- [&ap, &find](const shared_ptr<repository>& 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<repository> 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<repository> (""), db.query<available_package> (q));
}
t.commit ();