Skip to content
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

i18n: Unwind "Cannot {} package \"{}\"" message #1489

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion libdnf5/rpm/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,19 @@ void Transaction::erase(TransactionItem & item) {
}

void Transaction::install_up_down(TransactionItem & item, libdnf5::transaction::TransactionItemAction action) {
BgettextMessage msg_error;
std::string msg_action;
bool upgrade{true};
if (action == libdnf5::transaction::TransactionItemAction::UPGRADE) {
msg_error = M_("Cannot upgrade package \"{}\"");
msg_action = "upgrade";
} else if (action == libdnf5::transaction::TransactionItemAction::DOWNGRADE) {
downgrade_requested = true;
msg_error = M_("Cannot downgrade package \"{}\"");
msg_action = "downgrade";
} else if (action == libdnf5::transaction::TransactionItemAction::INSTALL) {
upgrade = false;
msg_error = M_("Cannot install package \"{}\"");
msg_action = "install";
} else {
libdnf_throw_assertion("Unsupported action: {}", utils::to_underlying(action));
Expand All @@ -378,7 +382,7 @@ void Transaction::install_up_down(TransactionItem & item, libdnf5::transaction::
headerFree(header);
if (rc != 0) {
//TODO(jrohel): Why? Librpm does not provide this information.
throw TransactionError(M_("Cannot {} package \"{}\""), msg_action, item.get_package().get_full_nevra());
throw TransactionError(msg_error, item.get_package().get_full_nevra());
}
libdnf_assert(
last_item_added_ts_element,
Expand Down
Loading