From e70163685afe5cae1ebe055a53ce353ae9cbe590 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 3 Nov 2015 13:39:06 +0200 Subject: Make loader loading external repository complements --- loader/loader.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'loader') diff --git a/loader/loader.cxx b/loader/loader.cxx index 633521f..ecc6032 100644 --- a/loader/loader.cxx +++ b/loader/loader.cxx @@ -372,9 +372,9 @@ load_packages (const shared_ptr& rp, database& db) db.persist (rp); // Save the repository state. } -// Load the prerequsite repositories state from the 'repositories' file. -// Update the repository persistent state to save repositories_timestamp -// member. Should be called once per internal repository. +// Load the prerequsite repositories and their complements state from the +// 'repositories' file. Update the repository persistent state to save +// repositories_timestamp member. Should be called once per internal repository. // static void load_prerequisites (const shared_ptr& rp, database& db) @@ -384,10 +384,6 @@ load_prerequisites (const shared_ptr& rp, database& db) // assert (rp->repositories_timestamp == timestamp_nonexistent); - // Load prerequisites for internal repositories only. - // - assert (rp->internal); - // Only locally accessible repositories allowed until package manager API is // ready. // @@ -399,6 +395,7 @@ load_prerequisites (const shared_ptr& rp, database& db) ifstream ifs; path p (rp->local_path / path ("repositories")); rp->repositories_timestamp = manifest_stream (p, ifs); + db.update (rp); manifest_parser mp (ifs, p.string ()); rpm = repository_manifests (mp); @@ -406,7 +403,9 @@ load_prerequisites (const shared_ptr& rp, database& db) for (auto& rm: rpm) { - if (rm.location.empty ()) + if (rm.location.empty () || + (!rp->internal && + rm.effective_role () == repository_role::prerequisite)) continue; // Ignore entry for this repository. repository_location rl; @@ -472,11 +471,8 @@ load_prerequisites (const shared_ptr& rp, database& db) } load_packages (pr, db); + load_prerequisites (pr, db); } - - // Updates repositories_timestamp member. - // - db.update (rp); } int -- cgit v1.1