]> git.ipfire.org Git - pakfire.git/commitdiff
UI: If Pakfire does not have a confirm callback set, log the message
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 9 Nov 2022 10:05:52 +0000 (10:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 9 Nov 2022 10:05:52 +0000 (10:05 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c
src/libpakfire/transaction.c

index 9410bd3d3095a4b985cab75e0cf26e17c7ce60a2..0e22e86d69621c021c3f7140a51c6fb8d0bbd3d6 100644 (file)
@@ -1540,13 +1540,15 @@ PAKFIRE_EXPORT void pakfire_set_confirm_callback(struct pakfire* pakfire,
 }
 
 int pakfire_confirm(struct pakfire* pakfire, const char* message, const char* question) {
-       // No callback configured
-       if (!pakfire->callbacks.confirm)
-               return 0;
-
        // Run callback
-       return pakfire->callbacks.confirm(
-               pakfire, pakfire->callbacks.confirm_data, message, question);
+       if (pakfire->callbacks.confirm)
+               return pakfire->callbacks.confirm(
+                       pakfire, pakfire->callbacks.confirm_data, message, question);
+
+       // If no callback is set, we just log the message
+       INFO(pakfire, "%s\n", message);
+
+       return 0;
 }
 
 static const char* pakfire_user_lookup(void* data, la_int64_t uid) {
index b396a9ef6da9d2cd5f281bcea256f614f5ad5eb8..512fbab42ee1f5ead1ccfc905fd5c1df14ab9641 100644 (file)
@@ -1268,9 +1268,6 @@ PAKFIRE_EXPORT int pakfire_transaction_run(
                goto ERROR;
        }
 
-       // Write transaction dump to log
-       INFO(transaction->pakfire, "%s\n", dump);
-
        // Perform a check if this can actually be run
        r = pakfire_transaction_check(transaction);
        if (r)