-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpm: New callbacks to wrap whole rpm transaction #1250
Conversation
The code looks good, but then new signals are missing a documentation in dnf5daemon-server/dbus/interfaces/org.rpm.dnf.v0.rpm.Rpm.xml. Please add the documentation. |
The three failing scenarios about installonly packages are not related (a change in libsolv). |
Oh, right. Will do. |
3121dba
to
4c8bdb7
Compare
@ppisar Done. Sorry for the rebase, I didn't want to add more noise to git history using new commits. |
Oh, int remained mentioned in the commit message... |
New couple of transaction callbacks which are fired around the rpmtsRun() call. TransactionCallbacks::before_begin(uint64_t total) - parameter total contains number of elements in the rpm transaction. TransactionCallbacks::after_complete(bool success) - success indicates whether the transaction finished successfully. For #1189
Use the new callbacks before_begin / after_complete to signal clients about overall transaction progress.
4c8bdb7
to
d9fb3e1
Compare
Thew new RPM build failure in F41 ("Directory not found: /builddir/build/BUILDROOT/dnf5-5.1.12-1.20240216152113944400.pr1250.22.gd9fb3e11.fc41.x86_64/usr/share/bash-completion") in unrelated. |
@@ -69,6 +69,13 @@ class TransactionCallbacks { | |||
|
|||
virtual ~TransactionCallbacks() = default; | |||
|
|||
/// Called right before the rpm transaction is run | |||
/// @param total Number of elements in the rpm transaction | |||
virtual void before_begin(uint64_t total) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/usr/include/libdnf5/rpm/transaction_callbacks.hpp is a public header. Adding virtual methods breaks its ABI. Can this feature be implemented without virtual methods, or in a private class? Otherwise, we need to postpone this pull request until a window for ABI change opens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ech. OK then, moving the PR to 5.2.
The change breaks ABI, moving to 5.2. |
There is currently no way for dnf5daemon user to find out when the rpm
transaction began and when it finished.
The change introduces two new callbacks on rpm::TransactionCallbacks class:
TransactionCallbacks::before_begin(int total)
TransactionCallbacks::after_complete(bool success)
These callbacks are then used in dnf5daemon-server to send respective signals
to the client.
Resolves #1189