From aacff79e854d6d4eb22540339bc88c3efab353a2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 5 Nov 2015 17:41:16 +0200 Subject: Implement package dependency resolution --- brep/package-details.cxx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'brep/package-details.cxx') diff --git a/brep/package-details.cxx b/brep/package-details.cxx index f814ef8..0424d5b 100644 --- a/brep/package-details.cxx +++ b/brep/package-details.cxx @@ -10,6 +10,7 @@ #include +#include #include #include @@ -119,6 +120,7 @@ namespace brep << A(HREF=url (!f, sq, pg)) << (f ? "[brief]" : "[full]") << ~A << ~DIV; + session sn; transaction t (db_->begin ()); shared_ptr p; @@ -172,13 +174,12 @@ namespace brep "OFFSET" + to_string (pg * rp) + "LIMIT" + to_string (rp))); - s << FORM_SEARCH (sq.c_str ()) - << DIV_COUNTER (pc, "Version", "Versions") - - // Enclose the subsequent tables to be able to use nth-child CSS selector. - // - << DIV; + s << FORM_SEARCH (sq) + << DIV_COUNTER (pc, "Version", "Versions"); + // Enclose the subsequent tables to be able to use nth-child CSS selector. + // + s << DIV; for (const auto& pr: r) { shared_ptr p (db_->load (pr.id)); @@ -187,7 +188,7 @@ namespace brep << TBODY << TR_VERSION (name, p->version.string ()) - // @@ Shouldn't we skip low priority row ? + // @@ Shouldn't we skip low priority row ? Don't think so, why? // << TR_PRIORITY (p->priority); @@ -200,24 +201,27 @@ namespace brep assert (p->internal_repository != nullptr); // @@ Shouldn't we make package location to be a link to the proper - // place of the About page, describing corresponding repository ? + // place of the About page, describing corresponding repository? + // Yes, I think that's sounds reasonable, once we have about. // // @@ In most cases package location will be the same for all versions // of the same package. Shouldn't we put package location to the // package summary part and display it here only if it differes // from the one in the summary ? // + // Hm, I am not so sure about this. Consider: stable/testing/unstable. + // s << TR_LOCATION (p->internal_repository.object_id ()) << TR_DEPENDS (p->dependencies) << TR_REQUIRES (p->requirements) << ~TBODY << ~TABLE; } + s << ~DIV; t.commit (); - s << ~DIV - << DIV_PAGER (pg, pc, rp, options_->pages_in_pager (), url (f, sq)) + s << DIV_PAGER (pg, pc, rp, options_->pages_in_pager (), url (f, sq)) << ~DIV << ~BODY << ~HTML; -- cgit v1.1