summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 = ?