Commit a8252b0a authored by Lukas Appelhans's avatar Lukas Appelhans

Make sure we update and remove makedepends as well

parent 3d60a470
......@@ -726,6 +726,7 @@ int QueryPerformer::removePackage(AbstractSQLiteConnection &dbConnection, Packag
dbConnection.query("DELETE FROM belongsgroup WHERE package=" + QString::number(p->databaseId()));
dbConnection.query("DELETE FROM depends WHERE package=" + QString::number(p->databaseId()));
dbConnection.query("DELETE FROM makedepends WHERE package=" + QString::number(p->databaseId()));
dbConnection.query("DELETE FROM optional WHERE package=" + QString::number(p->databaseId()));
dbConnection.query("DELETE FROM replaces WHERE package=" + QString::number(p->databaseId()));
dbConnection.query("DELETE FROM provides WHERE package=" + QString::number(p->databaseId()));
......@@ -815,6 +816,7 @@ int QueryPerformer::updatePackage(AbstractSQLiteConnection &dbConnection, int fr
dbConnection.query("DELETE FROM conflicts WHERE package=" + QString::number(from));
dbConnection.query("DELETE FROM providesmimetype WHERE package=" + QString::number(from));
dbConnection.query("DELETE FROM licensed WHERE package=" + QString::number(from));
dbConnection.query("DELETE FROM makedepends WHERE package=" + QString::number(from));
foreach (Akabei::Group *group, p->groups()) {
// Can I assume the group already exists?
......@@ -832,6 +834,13 @@ int QueryPerformer::updatePackage(AbstractSQLiteConnection &dbConnection, int fr
dbConnection.query(sqlQuery);
}
foreach (const QString& makedep, p->makeDependencies()) {
sqlQuery = "INSERT INTO makedepends ('package', 'dependency') VALUES (:Package, :MakeDepend);";
dbConnection.bind(":Package", from);
dbConnection.bind(":MakeDepend", makedep);
dbConnection.query(sqlQuery);
}
foreach (const QString& opt, p->optionalDependencies()) {
sqlQuery = "INSERT INTO optional ('package', 'dependency') VALUES (:Package, :OptDepend);";
dbConnection.bind(":Package", from);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment