From bc965df24ffae81e9a05f63b31d46fa01a8d52d9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 10 Oct 2015 15:37:13 +0200 Subject: Rename package_version class to package --- loader/loader.cxx | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'loader') diff --git a/loader/loader.cxx b/loader/loader.cxx index 9ddd7c2..5a71305 100644 --- a/loader/loader.cxx +++ b/loader/loader.cxx @@ -275,9 +275,9 @@ load_packages (const shared_ptr& rp, database& db) for (auto& pm: pkm) { - shared_ptr pv ( - db.find ( - package_version_id + shared_ptr p ( + db.find ( + package_id { pm.name, { @@ -287,11 +287,11 @@ load_packages (const shared_ptr& rp, database& db) } })); - if (pv == nullptr) + if (p == nullptr) { if (rp->internal) { - // Create internal package version object. + // Create internal package object. // optional dsc; if (pm.description) @@ -322,7 +322,7 @@ load_packages (const shared_ptr& rp, database& db) } } - pv = make_shared( + p = make_shared ( move (pm.name), move (pm.version), pm.priority ? move (*pm.priority) : priority (), @@ -341,20 +341,17 @@ load_packages (const shared_ptr& rp, database& db) rp); } else - // Create external package version object. + // Create external package object. // - pv = make_shared( - move (pm.name), - move (pm.version), - rp); + p = make_shared (move (pm.name), move (pm.version), rp); - db.persist (pv); + db.persist (p); } else { - // @@ Need to ensure that the same package versions coming from - // different repositories are equal. Probably will invent hashsum at - // some point for this purpose. + // @@ Need to ensure that the same packages coming from different + // repositories are equal. Probably will invent hashsum at some point + // for this purpose. // if (rp->internal) @@ -363,14 +360,14 @@ load_packages (const shared_ptr& rp, database& db) // // As soon as internal repositories get loaded first, the internal - // package version can duplicate an internal package version only. + // package can duplicate an internal package only. // - assert (pv->internal_repository != nullptr); + assert (p->internal_repository != nullptr); } else { - pv->external_repositories.push_back (rp); - db.update (pv); + p->external_repositories.push_back (rp); + db.update (p); } } } @@ -565,7 +562,7 @@ main (int argc, char* argv[]) { // Rebuild repositories persistent state from scratch. // - db.erase_query (); + db.erase_query (); db.erase_query (); // On the first pass over the internal repositories we load their -- cgit v1.1