From 3eab91b13fd8d3fff3ccfabcdf20669655d35ada Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 10 Apr 2017 16:39:15 +0100 Subject: Ensure target category of move exists --- gentoobrowse-api/service/maintenance/updatesProcessor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gentoobrowse-api/service/maintenance/updatesProcessor.cpp b/gentoobrowse-api/service/maintenance/updatesProcessor.cpp index 25cebe0..5765c17 100644 --- a/gentoobrowse-api/service/maintenance/updatesProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/updatesProcessor.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ namespace Gentoo { public: UpdatesPatch(DB::Connection * db, bool v) : vcsMode(v), + categoryInsert(sql::maintenance::categoryInsert.modify(db)), movePackageDirFiles(sql::maintenance::updatesPackageDirFiles.modify(db)), moveMD5CacheFiles(sql::maintenance::updatesMD5CacheFiles.modify(db)), findPackage(sql::portage::findPackage.select(db)), @@ -66,6 +68,7 @@ namespace Gentoo { const bool vcsMode; DB::ModifyCommandPtr drop; + DB::ModifyCommandPtr categoryInsert; DB::ModifyCommandPtr movePackageDirFiles; DB::ModifyCommandPtr moveMD5CacheFiles; DB::SelectCommandPtr findPackage; @@ -101,6 +104,9 @@ namespace Gentoo { moveMD5CacheFiles->bindParamS(3, catfrom); moveMD5CacheFiles->bindParamS(4, namefrom); moveMD5CacheFiles->execute(); + categoryInsert->bindParamS(0, catto); + categoryInsert->bindParamS(1, catto); + categoryInsert->execute(); movePackages->bindParamS(0, nameto); movePackages->bindParamS(1, namefrom); movePackages->bindParamS(2, catfrom); -- cgit v1.2.3