From f3a8bff4554bf3031d10be505dffbaa938293aaa Mon Sep 17 00:00:00 2001 From: Jaroslav Mracek Date: Thu, 20 Jun 2024 10:57:50 +0200 Subject: [PATCH] Add "Complete!" message after succesfull transaction Keeping the last message something abou scriptlets is not clear message that everything passed correctly and program was terminated correctly. The commit uses the same message like DNF4. Contrary to DNF4, this commit does not add Complete! message when there is anything to perform - no transaction table. Closes: https://github.com/rpm-software-management/dnf5/issues/613 --- dnf5/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dnf5/main.cpp b/dnf5/main.cpp index 8c26b13a9..1771bf39f 100644 --- a/dnf5/main.cpp +++ b/dnf5/main.cpp @@ -1444,6 +1444,11 @@ int main(int argc, char * argv[]) try { log_router.info("DNF5 finished"); + // Print Complete! message only when transaction is created to prevent poluting output from repoquery or other command + if (auto * transaction = context.get_transaction(); transaction && !transaction->empty()) { + std::cout << "Complete!\n"; + } + return static_cast(libdnf5::cli::ExitCode::SUCCESS); } catch (const libdnf5::Error & e) { std::cerr << libdnf5::format(e, libdnf5::FormatDetailLevel::WithName);