]> git.ipfire.org Git - pakfire.git/commitdiff
transaction: Reload database after finishing transaction
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 May 2021 13:33:03 +0000 (13:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 May 2021 13:33:03 +0000 (13:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/transaction.c

index fe143d5c44c42871f386b367e9076de89846b474..0e05873d89371dab7706ccb65b2f549d9b6fb97c 100644 (file)
@@ -745,6 +745,7 @@ static int pakfire_transaction_open_archives(struct pakfire_transaction* transac
 }
 
 PAKFIRE_EXPORT int pakfire_transaction_run(struct pakfire_transaction* transaction) {
+       PakfireRepo repo = NULL;
        struct pakfire_db* db;
        int r;
 
@@ -783,8 +784,18 @@ PAKFIRE_EXPORT int pakfire_transaction_run(struct pakfire_transaction* transacti
 
        DEBUG(transaction->pakfire, "The transaction has finished successfully\n");
 
+       // Reload database for next transaction
+
+       repo = pakfire_get_installed_repo(transaction->pakfire);
+       if (!repo)
+               goto ERROR;
+
+       // Reload the database
+       r = pakfire_db_load(db, repo);
+
 ERROR:
-       // Free the database
+       if (repo)
+               pakfire_repo_unref(repo);
        pakfire_db_unref(db);
 
        return r;