From: Michael Tremer Date: Wed, 9 Nov 2022 10:05:52 +0000 (+0000) Subject: UI: If Pakfire does not have a confirm callback set, log the message X-Git-Tag: 0.9.28~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53921c961ffaa51f522e4a8288ef50a3ddaf6725;p=pakfire.git UI: If Pakfire does not have a confirm callback set, log the message Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index 9410bd3d3..0e22e86d6 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -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) { diff --git a/src/libpakfire/transaction.c b/src/libpakfire/transaction.c index b396a9ef6..512fbab42 100644 --- a/src/libpakfire/transaction.c +++ b/src/libpakfire/transaction.c @@ -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)