From 33415756ba50f7325a79fba86aeb2322d7393251 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 30 Apr 2016 01:52:18 +0100 Subject: IceTray compat fix --- .../service/maintenance/categoryMetaProcessor.cpp | 4 +-- .../service/maintenance/ebuildMetaProcessor.cpp | 16 +++++----- .../service/maintenance/packageMetaProcessor.cpp | 4 +-- .../service/maintenance/useGroupProcessor.cpp | 6 ++-- .../service/maintenance/useLocalProcessor.cpp | 2 +- gentoobrowse-api/service/maintenanceimpl.cpp | 4 +-- gentoobrowse-api/service/portageimpl.cpp | 34 +++++++++++----------- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/gentoobrowse-api/service/maintenance/categoryMetaProcessor.cpp b/gentoobrowse-api/service/maintenance/categoryMetaProcessor.cpp index 23d6699..bf7c35c 100644 --- a/gentoobrowse-api/service/maintenance/categoryMetaProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/categoryMetaProcessor.cpp @@ -21,7 +21,7 @@ namespace Gentoo { void CategoryMetaProcessor::modified(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const { - DB::ModifyCommandPtr m = dbc->modify(sql::maintenance::categoryMetaUpdate::sql); + DB::ModifyCommandPtr m = dbc->modify(sql::maintenance::categoryMetaUpdate.getSql()); U::XmlDoc md(path); U::Database::bindOptionalsS(m.get(), 0, { md.getXPathValue("/catmetadata/longdescription[@lang='en']/text()"), @@ -34,7 +34,7 @@ namespace Gentoo { void CategoryMetaProcessor::deleted(DB::Connection * dbc, const boost::filesystem::path & fn) const { - auto m = dbc->modify(sql::maintenance::categoryMetaUpdate::sql); + auto m = dbc->modify(sql::maintenance::categoryMetaUpdate.getSql()); m->bindNull(0); m->bindParamS(1, (fn / 1).string()); m->execute(); diff --git a/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp b/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp index 7477c63..7d55440 100644 --- a/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp @@ -43,19 +43,19 @@ namespace Gentoo { const std::string ebuildVersion = matches.fetch(2); // Maybe create a category - auto ci = dbc->modify(sql::maintenance::categoryInsert::sql); + auto ci = dbc->modify(sql::maintenance::categoryInsert.getSql()); ci->bindParamS(0, categoryName); ci->bindParamS(1, categoryName); ci->execute(); // Maybe create a package - auto pi = dbc->modify(sql::maintenance::packageInsert::sql); + auto pi = dbc->modify(sql::maintenance::packageInsert.getSql()); pi->bindParamS(0, packageName); Utils::Database::bindOptionalsS(pi.get(), 1, { ecp.get("DESCRIPTION") }); pi->bindParamS(2, packageName); pi->bindParamS(3, categoryName); pi->execute(); // Create an ebuild - auto m = dbc->select(sql::maintenance::ebuildInsert::sql); + auto m = dbc->select(sql::maintenance::ebuildInsert.getSql()); m->bindParamS(0, ebuildVersion); m->bindParamS(1, ebuildVersion); Utils::Database::bindOptionalsS(m.get(), 2, { ecp.get("SLOT") }); @@ -77,7 +77,7 @@ namespace Gentoo { Glib::MatchInfo matches; const Glib::ustring pv = (fn / 4).string(); if (packageVersion->match(pv, matches)) { - auto m = dbc->select(sql::maintenance::ebuildUpdate::sql); + auto m = dbc->select(sql::maintenance::ebuildUpdate.getSql()); U::EbuildCacheParser ecp(path); Utils::Database::bindOptionalsS(m.get(), 0, { ecp.get("SLOT") }); Utils::Database::bindOptionalsS(m.get(), 1, { ecp.get("LICENSE") }); @@ -125,7 +125,7 @@ namespace Gentoo { t.where = &pwf; dbc->patchTable(&t); // Description - auto u = dbc->modify(sql::maintenance::packageDescUpdate::sql); + auto u = dbc->modify(sql::maintenance::packageDescUpdate.getSql()); Utils::Database::bindOptionalsS(u.get(), 0, { ecp.get("DESCRIPTION") }); u->bindParamI(1, packageId); u->execute(); @@ -144,18 +144,18 @@ namespace Gentoo { const std::string ebuildVersion = matches.fetch(2); // Delete ebuild - auto m = dbc->modify(sql::maintenance::ebuildDelete::sql); + auto m = dbc->modify(sql::maintenance::ebuildDelete.getSql()); m->bindParamS(0, repoName); m->bindParamS(1, categoryName); m->bindParamS(2, packageName); m->bindParamS(3, ebuildVersion); m->execute(false); // Prune packages - auto pp = dbc->modify(sql::maintenance::packagePrune::sql); + auto pp = dbc->modify(sql::maintenance::packagePrune.getSql()); pp->bindParamS(0, categoryName); pp->execute(); // Prune categories - dbc->modify(sql::maintenance::categoryPrune::sql)->execute(); + dbc->modify(sql::maintenance::categoryPrune.getSql())->execute(); } } } diff --git a/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp b/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp index f0d9405..55aa1ee 100644 --- a/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp @@ -21,7 +21,7 @@ namespace Gentoo { void PackageMetaProcessor::modified(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const { - auto m = dbc->modify(sql::maintenance::packageMetaUpdate::sql); + auto m = dbc->modify(sql::maintenance::packageMetaUpdate.getSql()); U::XmlDoc md(path); U::Database::bindOptionalsS(m.get(), 0, { md.getXPathValue("/pkgmetadata/longdescription[@lang='en']/text()"), @@ -38,7 +38,7 @@ namespace Gentoo { void PackageMetaProcessor::deleted(DB::Connection * dbc, const boost::filesystem::path & fn) const { - auto m = dbc->modify(sql::maintenance::packageMetaUpdate::sql); + auto m = dbc->modify(sql::maintenance::packageMetaUpdate.getSql()); m->bindNull(0); m->bindNull(1); m->bindParamS(2, (fn / 1).string()); diff --git a/gentoobrowse-api/service/maintenance/useGroupProcessor.cpp b/gentoobrowse-api/service/maintenance/useGroupProcessor.cpp index 5fbdbca..0689b1b 100644 --- a/gentoobrowse-api/service/maintenance/useGroupProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/useGroupProcessor.cpp @@ -21,7 +21,7 @@ namespace Gentoo { void UseGroupProcessor::created(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const { - auto m = dbc->select(sql::maintenance::useGroupsInsert::sql); + auto m = dbc->select(sql::maintenance::useGroupsInsert.getSql()); m->bindParamS(0, fn.stem().string()); m->forEachRow([this, dbc, &path](auto useGroupId) { this->mergeContent(dbc, path, useGroupId); @@ -31,7 +31,7 @@ namespace Gentoo { void UseGroupProcessor::modified(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const { - auto m = dbc->select(sql::maintenance::useGroupsGetId::sql); + auto m = dbc->select(sql::maintenance::useGroupsGetId.getSql()); m->bindParamS(0, fn.stem().string()); m->forEachRow([this, dbc, &path](auto useGroupId) { this->mergeContent(dbc, path, useGroupId); @@ -72,7 +72,7 @@ namespace Gentoo { void UseGroupProcessor::deleted(DB::Connection * dbc, const boost::filesystem::path & fn) const { - auto m = dbc->modify(sql::maintenance::useGroupsDelete::sql); + auto m = dbc->modify(sql::maintenance::useGroupsDelete.getSql()); m->bindParamS(0, fn.stem().string()); m->execute(); } diff --git a/gentoobrowse-api/service/maintenance/useLocalProcessor.cpp b/gentoobrowse-api/service/maintenance/useLocalProcessor.cpp index 065022e..e89ddfc 100644 --- a/gentoobrowse-api/service/maintenance/useLocalProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/useLocalProcessor.cpp @@ -32,7 +32,7 @@ namespace Gentoo { { "description", "text" } }); p.dest = "gentoobrowse.use_local"; - DB::StaticSqlWriter srcExpr(sql::maintenance::useLocalMap::sql); + DB::StaticSqlWriter srcExpr(sql::maintenance::useLocalMap.getSql()); p.srcExpr = &srcExpr; p.pk = { "packageId", "use" }; p.cols = { "packageId", "use", "description" }; diff --git a/gentoobrowse-api/service/maintenanceimpl.cpp b/gentoobrowse-api/service/maintenanceimpl.cpp index 694fa56..d9cd32d 100644 --- a/gentoobrowse-api/service/maintenanceimpl.cpp +++ b/gentoobrowse-api/service/maintenanceimpl.cpp @@ -113,7 +113,7 @@ namespace Gentoo { dbc->select("SELECT name, path FROM gentoobrowse.repos")->forEachRow([&tmp](auto n, auto p) { boost::filesystem::create_symlink(p, tmp / n); }); - dbc->execute(sql::maintenance::createTempFileListTable::sql); + dbc->execute(sql::maintenance::createTempFileListTable.getSql()); auto i = dbc->modify("INSERT INTO filelist(filename, filesize, filemtime) VALUES(?, ?, ?)"); for (boost::filesystem::recursive_directory_iterator d(tmp, boost::filesystem::symlink_option::recurse); d != boost::filesystem::recursive_directory_iterator(); d++) { @@ -129,7 +129,7 @@ namespace Gentoo { void Maintenance::processChanges(DB::Connection * dbc, const boost::filesystem::path & tmp) { - DB::StaticSqlWriter src(sql::maintenance::fileList::sql); + DB::StaticSqlWriter src(sql::maintenance::fileList.getSql()); DB::TablePatch tp; tp.srcExpr = &src; tp.dest = "gentoobrowse.files"; diff --git a/gentoobrowse-api/service/portageimpl.cpp b/gentoobrowse-api/service/portageimpl.cpp index af446d9..1a5b96c 100644 --- a/gentoobrowse-api/service/portageimpl.cpp +++ b/gentoobrowse-api/service/portageimpl.cpp @@ -27,103 +27,103 @@ Portage::Portage(boost::shared_ptr> d) : Gentoo::CategoryPtr Portage::getCategory(Ice::Int id, const Ice::Current &) { - return fetchCache(30, id); + return fetchCache(sql::portage::getCategory, 30, id); } Gentoo::Categories Portage::getAllCategories(const Ice::Current &) { - return fetchCache(30); + return fetchCache(sql::portage::getAllCategories, 30); } Gentoo::Categories Portage::getCategoriesInSuper(const std::string & super, const Ice::Current &) { - return fetchCache(30, super); + return fetchCache(sql::portage::getCategoriesInSuper, 30, super); } Gentoo::OverviewCategories Portage::getOverviewCategoriesInSuper(const std::string & super, const Ice::Current &) { - return fetchCache(30, super); + return fetchCache(sql::portage::getOverviewCategoriesInSuper, 30, super); } Gentoo::PackagePtr Portage::getPackage(Ice::Int id, const Ice::Current &) { - return fetchCache(30, id); + return fetchCache(sql::portage::getPackage, 30, id); } IceUtil::Optional Portage::findPackage(const std::string & cat, const std::string & pkg, const Ice::Current &) { - return fetchCache, sql::portage::findPackage>(30, cat, pkg); + return fetchCache>(sql::portage::findPackage, 30, cat, pkg); } Gentoo::Packages Portage::getPackagesInCategory(Ice::Int id, const Ice::Current &) { - return fetchCache(30, id); + return fetchCache(sql::portage::getPackagesInCategory, 30, id); } Gentoo::SearchResultPackages Portage::getPackagesSearch(const std::string & query, const Ice::Current &) { - return fetchCache(30, query, query); + return fetchCache(sql::portage::getPackagesSearch, 30, query, query); } Gentoo::Ebuilds Portage::getPackageVersions(Ice::Int id, const Ice::Current &) { - return fetchCache(30, id); + return fetchCache(sql::portage::getPackageVersions, 30, id); } Gentoo::ChangeLog Portage::getPackageChangeLog(Ice::Int id, const Ice::Current &) { - return fetchCache(30, id); + return fetchCache(sql::portage::getPackageChangeLog, 30, id); } Gentoo::Ebuilds Portage::getRecentAdditions(Ice::Int syncs, const Ice::Current &) { - return fetchCache(30, syncs); + return fetchCache(sql::portage::getRecentAdditions, 30, syncs); } Gentoo::BugPtr Portage::getBug(Ice::Int id, const Ice::Current &) { - return fetchCache(30, id); + return fetchCache(sql::portage::getBug, 30, id); } Gentoo::Bugs Portage::getPackageBugs(Ice::Int packageId, const Ice::Current &) { - return fetchCache(30, packageId); + return fetchCache(sql::portage::getPackageBugs, 30, packageId); } Gentoo::SearchResultBugs Portage::getBugsSearch(const std::string & query, const Ice::Current &) { - return fetchCache(30, query, query); + return fetchCache(sql::portage::getBugsSearch, 30, query, query); } Gentoo::NewsItemPtr Portage::getNewsItem(const std::string & id, const Ice::Current &) { - return fetchCache(30, id); + return fetchCache(sql::portage::getNewsItem, 30, id); } Gentoo::News Portage::getNewsSearch(const std::string & query, const Ice::Current &) { - return fetchCache(30, query); + return fetchCache(sql::portage::getNewsSearch, 30, query); } Gentoo::News Portage::getNewsRecent(Ice::Int items, const Ice::Current &) { - return fetchCache(30, items); + return fetchCache(sql::portage::getNewsRecent, 30, items); } } } -- cgit v1.2.3