diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-11 15:50:48 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-11 17:53:08 +0200 |
commit | e80ebd1c1a6fe7749c1565c4a9e2fccaa07d5d95 (patch) | |
tree | 6cc8e8d6f65d3cd631e458e62c9c74ed9de29411 /loader | |
parent | aacff79e854d6d4eb22540339bc88c3efab353a2 (diff) |
Add package::internal() predicate
Diffstat (limited to 'loader')
-rw-r--r-- | loader/loader.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/loader/loader.cxx b/loader/loader.cxx index 74844f5..782d3f3 100644 --- a/loader/loader.cxx +++ b/loader/loader.cxx @@ -372,7 +372,7 @@ load_packages (const shared_ptr<repository>& rp, database& db) // As soon as internal repositories get loaded first, the internal // package can duplicate an internal package only. // - assert (!rp->internal || p->internal_repository != nullptr); + assert (!rp->internal || p->internal ()); p->other_repositories.push_back (rp); db.update (p); @@ -560,10 +560,7 @@ resolve_dependencies (package& p, database& db) { // Resolve dependencies for internal packages only. // - // @@ add package::internal() predicate? Lots of place where you do - // (p.internal_repository != nullptr). - // - assert (p.internal_repository != nullptr); + assert (p.internal ()); if (p.dependencies.empty ()) return; @@ -651,12 +648,10 @@ detect_dependency_cycle (const package_id& id, package_ids& chain, database& db) [&o, &db](const package_id& id) { shared_ptr<package> p (db.load<package> (id)); - - assert (p->internal_repository != nullptr || - !p->other_repositories.empty ()); + assert (p->internal () || !p->other_repositories.empty ()); shared_ptr<repository> r ( - p->internal_repository != nullptr + p->internal () ? p->internal_repository.load () : p->other_repositories[0].load ()); |