From 34bfc296cd49e963c7c8c8af1f6a4a645d7fc571 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 25 Apr 2016 01:38:43 +0100 Subject: Update package description with new versions --- gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp | 6 ++++++ gentoobrowse-api/service/sql/maintenance/packageDescUpdate.sql | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 gentoobrowse-api/service/sql/maintenance/packageDescUpdate.sql diff --git a/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp b/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp index b63bb55..1bd8c6c 100644 --- a/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp @@ -11,6 +11,7 @@ #include "dbUtils.h" #include #include +#include #include #include #include @@ -202,6 +203,11 @@ namespace Gentoo { t.cols = { "packageId", "url" }; t.where = &pwf; dbc->patchTable(&t); + // Description + auto u = dbc->modify(sql::maintenance::packageDescUpdate::sql); + Utils::Database::bindOptionalsS(u.get(), 0, { ecp.get("DESCRIPTION") }); + u->bindParamI(1, packageId); + u->execute(); } } diff --git a/gentoobrowse-api/service/sql/maintenance/packageDescUpdate.sql b/gentoobrowse-api/service/sql/maintenance/packageDescUpdate.sql new file mode 100644 index 0000000..d3fed1c --- /dev/null +++ b/gentoobrowse-api/service/sql/maintenance/packageDescUpdate.sql @@ -0,0 +1,3 @@ +UPDATE gentoobrowse.packages p SET + description = ? +WHERE p.packageid = ? -- cgit v1.2.3