summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-04-23 17:36:46 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-04-25 21:27:50 +0100
commit843e1db61854f41cb721cd414659b8a1aa3c0bd8 (patch)
treea327e01eae9ae338a189e2fc6486c97555788518
parentRemove debug (diff)
downloadgentoobrowse-api-843e1db61854f41cb721cd414659b8a1aa3c0bd8.tar.bz2
gentoobrowse-api-843e1db61854f41cb721cd414659b8a1aa3c0bd8.tar.xz
gentoobrowse-api-843e1db61854f41cb721cd414659b8a1aa3c0bd8.zip
Add package herd support, even though none appear to have it at the moment.
-rw-r--r--gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp12
-rw-r--r--gentoobrowse-api/service/sql/maintenance/packageMetaUpdate.sql5
2 files changed, 11 insertions, 6 deletions
diff --git a/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp b/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp
index 1f99ce2..17af6a3 100644
--- a/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp
+++ b/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp
@@ -27,8 +27,11 @@ namespace Gentoo {
md.getXPathValue("/pkgmetadata/longdescription[@lang='en']/text()"),
md.getXPathValue("/pkgmetadata/longdescription[1]/text()")
});
- m->bindParamS(1, (fn / 1).string());
- m->bindParamS(2, (fn / 2).string());
+ U::Database::bindOptionalsS(m, 1, {
+ md.getXPathValue("/pkgmetadata/herd/text()")
+ });
+ m->bindParamS(2, (fn / 1).string());
+ m->bindParamS(3, (fn / 2).string());
m->execute();
}
@@ -43,8 +46,9 @@ namespace Gentoo {
{
auto m = dbc->modify(sql::maintenance::packageMetaUpdate::sql);
m->bindNull(0);
- m->bindParamS(1, (fn / 1).string());
- m->bindParamS(2, (fn / 2).string());
+ m->bindNull(1);
+ m->bindParamS(2, (fn / 1).string());
+ m->bindParamS(3, (fn / 2).string());
m->execute();
}
}
diff --git a/gentoobrowse-api/service/sql/maintenance/packageMetaUpdate.sql b/gentoobrowse-api/service/sql/maintenance/packageMetaUpdate.sql
index ec83634..c065d3f 100644
--- a/gentoobrowse-api/service/sql/maintenance/packageMetaUpdate.sql
+++ b/gentoobrowse-api/service/sql/maintenance/packageMetaUpdate.sql
@@ -1,5 +1,6 @@
-UPDATE gentoobrowse.packages p
- SET summary = gentoobrowse.textclean(?)
+UPDATE gentoobrowse.packages p SET
+ summary = gentoobrowse.textclean(?),
+ herd = ?
FROM gentoobrowse.categories c
WHERE p.categoryid = c.categoryid
AND c.name = ?