From 1a492c3a7661e5819e20cede5654e1a5b7b85a20 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 27 May 2016 19:23:09 +0100 Subject: Apply ebuild masks after import --- gentoobrowse-api/service/maintenance/masksProcessor.cpp | 9 ++++++--- gentoobrowse-api/service/maintenance/masksProcessor.h | 2 ++ 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; }; } } -- cgit v1.2.3