summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-05-27 19:23:09 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-05-27 19:23:09 +0100
commit1a492c3a7661e5819e20cede5654e1a5b7b85a20 (patch)
treeae27e24b84d4b613ee0cdf29fef4f46780a4827a
parentEmpty the right table on masks removal (diff)
downloadgentoobrowse-api-1a492c3a7661e5819e20cede5654e1a5b7b85a20.tar.bz2
gentoobrowse-api-1a492c3a7661e5819e20cede5654e1a5b7b85a20.tar.xz
gentoobrowse-api-1a492c3a7661e5819e20cede5654e1a5b7b85a20.zip
Apply ebuild masks after import
-rw-r--r--gentoobrowse-api/service/maintenance/masksProcessor.cpp9
-rw-r--r--gentoobrowse-api/service/maintenance/masksProcessor.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/gentoobrowse-api/service/maintenance/masksProcessor.cpp b/gentoobrowse-api/service/maintenance/masksProcessor.cpp
index 0bed3be..58975f1 100644
--- a/gentoobrowse-api/service/maintenance/masksProcessor.cpp
+++ b/gentoobrowse-api/service/maintenance/masksProcessor.cpp
@@ -88,16 +88,19 @@ namespace Gentoo {
p.cols = { "dateAdded", "n", "person", "email", "message", "atomSpec" };
dbc->patchTable(&p);
+ Utils::Database::drop(dbc, tempTable.first);
+ }
+
+ void
+ MasksProcessor::apply(DB::Connection * dbc)
+ {
DB::TablePatch e;
e.dest = "gentoobrowse.ebuild_masks";
DB::StaticSqlWriter srcExprE(sql::maintenance::masksEbuilds.getSql());
e.srcExpr = &srcExprE;
-
e.pk = { "ebuildId", "setNo" };
e.cols = e.pk;
dbc->patchTable(&e);
-
- Utils::Database::drop(dbc, tempTable.first);
}
void
diff --git a/gentoobrowse-api/service/maintenance/masksProcessor.h b/gentoobrowse-api/service/maintenance/masksProcessor.h
index 2fc2b39..a8c94a5 100644
--- a/gentoobrowse-api/service/maintenance/masksProcessor.h
+++ b/gentoobrowse-api/service/maintenance/masksProcessor.h
@@ -15,6 +15,8 @@ namespace Gentoo {
void created(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) override;
void modified(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) override;
void deleted(DB::Connection * dbc, const boost::filesystem::path & fn) override;
+
+ void apply(DB::Connection *) override;
};
}
}