aboutsummaryrefslogtreecommitdiff
path: root/brep/package-search.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-10-06 12:38:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-10-07 18:04:44 +0200
commit08ef171b0c5b9238df9fe0b86200a8d8425dcea5 (patch)
tree50e861fe0fc156afe02229fe8e6d032b40ac8b36 /brep/package-search.cxx
parentba93b336890205933a57fae958c0ec6be5932ac7 (diff)
Get rid of package class
Diffstat (limited to 'brep/package-search.cxx')
-rw-r--r--brep/package-search.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/brep/package-search.cxx b/brep/package-search.cxx
index 9b3fb2c..cc15e02 100644
--- a/brep/package-search.cxx
+++ b/brep/package-search.cxx
@@ -91,7 +91,7 @@ namespace brep
// @@ Query will include search criteria if specified.
//
- size_t pc (db_->query_value<internal_package_count> ().count);
+ size_t pc (db_->query_value<internal_package_count> ());
s << DIV(ID="packages") << "Packages (" << pc << ")" << ~DIV;
@@ -100,20 +100,19 @@ namespace brep
using query = query<latest_internal_package_version>;
auto r (
- db_->query<latest_internal_package_version> (
- "ORDER BY" + query::package::name +
+ db_->query<latest_internal_package_version> (query (true) +
+ "ORDER BY" + query::package_version::id.data.package +
"OFFSET" + to_string (pr.page () * rop) +
"LIMIT" + to_string (rop)));
for (const auto& ip: r)
{
- const package& p = *ip.package;
- const package_version& v = *ip.version;
+ const package_version& v (ip);
s << DIV(CLASS="package")
<< DIV(CLASS="name")
<< A
- << HREF << "/go/" << mime_url_encode (p.name);
+ << HREF << "/go/" << mime_url_encode (v.name);
// Propagate search criteria to the package version search url.
//
@@ -121,11 +120,11 @@ namespace brep
s << "?" << q;
s << ~HREF
- << p.name
+ << v.name
<< ~A
<< ~DIV
- << DIV(CLASS="summary") << p.summary << ~DIV
- << DIV_TAGS (p.tags)
+ << DIV(CLASS="summary") << v.summary << ~DIV
+ << DIV_TAGS (v.tags)
<< DIV_LICENSES (v.license_alternatives)
<< DIV(CLASS="dependencies")
<< "Dependencies: " << v.dependencies.size ()