summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-04-25 01:38:43 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-04-25 21:38:52 +0100
commit34bfc296cd49e963c7c8c8af1f6a4a645d7fc571 (patch)
tree589a20809be102cd8e61e761b924dc1fcae6f3bc
parentAdds count assertions (diff)
downloadgentoobrowse-api-34bfc296cd49e963c7c8c8af1f6a4a645d7fc571.tar.bz2
gentoobrowse-api-34bfc296cd49e963c7c8c8af1f6a4a645d7fc571.tar.xz
gentoobrowse-api-34bfc296cd49e963c7c8c8af1f6a4a645d7fc571.zip
Update package description with new versions
-rw-r--r--gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp6
-rw-r--r--gentoobrowse-api/service/sql/maintenance/packageDescUpdate.sql3
2 files changed, 9 insertions, 0 deletions
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 <sql/maintenance/categoryInsert.sql.h>
#include <sql/maintenance/packageInsert.sql.h>
+#include <sql/maintenance/packageDescUpdate.sql.h>
#include <sql/maintenance/packagePrune.sql.h>
#include <sql/maintenance/categoryPrune.sql.h>
#include <sql/maintenance/ebuildInsert.sql.h>
@@ -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 = ?