diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-04-30 01:52:18 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-04-30 01:52:18 +0100 |
commit | 5fe42dcc8bdebdbb3613b95c4bbc77c56640cec9 (patch) | |
tree | 41e4a147b56b90e9eca6e57b4deda05b0d9ca940 | |
parent | Rename badly named SQL expression (diff) | |
download | gentoobrowse-api-5fe42dcc8bdebdbb3613b95c4bbc77c56640cec9.tar.bz2 gentoobrowse-api-5fe42dcc8bdebdbb3613b95c4bbc77c56640cec9.tar.xz gentoobrowse-api-5fe42dcc8bdebdbb3613b95c4bbc77c56640cec9.zip |
IceTray compat fix
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<int64_t>([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<int64_t>([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<std::string, std::string>([&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<AdHoc::ResourcePool<DB::Connection>> d) : Gentoo::CategoryPtr Portage::getCategory(Ice::Int id, const Ice::Current &) { - return fetchCache<Gentoo::CategoryPtr, sql::portage::getCategory>(30, id); + return fetchCache<Gentoo::CategoryPtr>(sql::portage::getCategory, 30, id); } Gentoo::Categories Portage::getAllCategories(const Ice::Current &) { - return fetchCache<Gentoo::Categories, sql::portage::getAllCategories>(30); + return fetchCache<Gentoo::Categories>(sql::portage::getAllCategories, 30); } Gentoo::Categories Portage::getCategoriesInSuper(const std::string & super, const Ice::Current &) { - return fetchCache<Gentoo::Categories, sql::portage::getCategoriesInSuper>(30, super); + return fetchCache<Gentoo::Categories>(sql::portage::getCategoriesInSuper, 30, super); } Gentoo::OverviewCategories Portage::getOverviewCategoriesInSuper(const std::string & super, const Ice::Current &) { - return fetchCache<Gentoo::OverviewCategories, sql::portage::getOverviewCategoriesInSuper>(30, super); + return fetchCache<Gentoo::OverviewCategories>(sql::portage::getOverviewCategoriesInSuper, 30, super); } Gentoo::PackagePtr Portage::getPackage(Ice::Int id, const Ice::Current &) { - return fetchCache<Gentoo::PackagePtr, sql::portage::getPackage>(30, id); + return fetchCache<Gentoo::PackagePtr>(sql::portage::getPackage, 30, id); } IceUtil::Optional<Gentoo::PackagePtr> Portage::findPackage(const std::string & cat, const std::string & pkg, const Ice::Current &) { - return fetchCache<IceUtil::Optional<Gentoo::PackagePtr>, sql::portage::findPackage>(30, cat, pkg); + return fetchCache<IceUtil::Optional<Gentoo::PackagePtr>>(sql::portage::findPackage, 30, cat, pkg); } Gentoo::Packages Portage::getPackagesInCategory(Ice::Int id, const Ice::Current &) { - return fetchCache<Gentoo::Packages, sql::portage::getPackagesInCategory>(30, id); + return fetchCache<Gentoo::Packages>(sql::portage::getPackagesInCategory, 30, id); } Gentoo::SearchResultPackages Portage::getPackagesSearch(const std::string & query, const Ice::Current &) { - return fetchCache<Gentoo::SearchResultPackages, sql::portage::getPackagesSearch>(30, query, query); + return fetchCache<Gentoo::SearchResultPackages>(sql::portage::getPackagesSearch, 30, query, query); } Gentoo::Ebuilds Portage::getPackageVersions(Ice::Int id, const Ice::Current &) { - return fetchCache<Gentoo::Ebuilds, sql::portage::getPackageVersions>(30, id); + return fetchCache<Gentoo::Ebuilds>(sql::portage::getPackageVersions, 30, id); } Gentoo::ChangeLog Portage::getPackageChangeLog(Ice::Int id, const Ice::Current &) { - return fetchCache<Gentoo::ChangeLog, sql::portage::getPackageChangeLog>(30, id); + return fetchCache<Gentoo::ChangeLog>(sql::portage::getPackageChangeLog, 30, id); } Gentoo::Ebuilds Portage::getRecentAdditions(Ice::Int syncs, const Ice::Current &) { - return fetchCache<Gentoo::Ebuilds, sql::portage::getRecentAdditions>(30, syncs); + return fetchCache<Gentoo::Ebuilds>(sql::portage::getRecentAdditions, 30, syncs); } Gentoo::BugPtr Portage::getBug(Ice::Int id, const Ice::Current &) { - return fetchCache<Gentoo::BugPtr, sql::portage::getBug>(30, id); + return fetchCache<Gentoo::BugPtr>(sql::portage::getBug, 30, id); } Gentoo::Bugs Portage::getPackageBugs(Ice::Int packageId, const Ice::Current &) { - return fetchCache<Gentoo::Bugs, sql::portage::getPackageBugs>(30, packageId); + return fetchCache<Gentoo::Bugs>(sql::portage::getPackageBugs, 30, packageId); } Gentoo::SearchResultBugs Portage::getBugsSearch(const std::string & query, const Ice::Current &) { - return fetchCache<Gentoo::SearchResultBugs, sql::portage::getBugsSearch>(30, query, query); + return fetchCache<Gentoo::SearchResultBugs>(sql::portage::getBugsSearch, 30, query, query); } Gentoo::NewsItemPtr Portage::getNewsItem(const std::string & id, const Ice::Current &) { - return fetchCache<Gentoo::NewsItemPtr, sql::portage::getNewsItem>(30, id); + return fetchCache<Gentoo::NewsItemPtr>(sql::portage::getNewsItem, 30, id); } Gentoo::News Portage::getNewsSearch(const std::string & query, const Ice::Current &) { - return fetchCache<Gentoo::News, sql::portage::getNewsSearch>(30, query); + return fetchCache<Gentoo::News>(sql::portage::getNewsSearch, 30, query); } Gentoo::News Portage::getNewsRecent(Ice::Int items, const Ice::Current &) { - return fetchCache<Gentoo::News, sql::portage::getNewsRecent>(30, items); + return fetchCache<Gentoo::News>(sql::portage::getNewsRecent, 30, items); } } } |