Skip to content

Commit

Permalink
offline: Inform user about scriptlets execution
Browse files Browse the repository at this point in the history
Scriptlet execution can take a significant amount of time. Inform the
user when it starts.
  • Loading branch information
m-blaha committed Feb 25, 2025
1 parent ee0e203 commit 9aff719
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dnf5/commands/offline/offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include <libdnf5/base/goal.hpp>
#include <libdnf5/conf/const.hpp>
#include <libdnf5/conf/option_path.hpp>
#include <libdnf5/rpm/nevra.hpp>
#include <libdnf5/sdbus_compat.hpp>
#include <libdnf5/transaction/offline.hpp>
#include <libdnf5/utils/bgettext/bgettext-lib.h>
Expand Down Expand Up @@ -170,6 +171,17 @@ class PlymouthTransCB : public RpmTransCB {
plymouth.message(message);
}

void script_start(
const libdnf5::base::TransactionPackage * item,
libdnf5::rpm::Nevra nevra,
libdnf5::rpm::TransactionCallbacks::ScriptType type) override {
RpmTransCB::script_start(item, nevra, type);

const auto message = fmt::format(
"Running {} scriptlet: {}...", script_type_to_string(type), to_full_nevra_string(nevra).c_str());
plymouth.message(message);
}

private:
PlymouthOutput plymouth;
};
Expand Down

0 comments on commit 9aff719

Please sign in to comment.