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

Since we use rpmtsAddReinstallElement rpm also uninstalls the package #1660

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
15 changes: 12 additions & 3 deletions libdnf/dnf-transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ dnf_transaction_ts_progress_cb(const void *arg,

/* map to correct action code */
action = dnf_package_get_action(pkg);
if (action == DNF_STATE_ACTION_UNKNOWN)
if (action == DNF_STATE_ACTION_UNKNOWN || action == DNF_STATE_ACTION_REINSTALL)
action = DNF_STATE_ACTION_INSTALL;

/* set the pkgid if not already set */
Expand Down Expand Up @@ -641,7 +641,7 @@ dnf_transaction_ts_progress_cb(const void *arg,

/* map to correct action code */
action = dnf_package_get_action(pkg);
if (action == DNF_STATE_ACTION_UNKNOWN)
if (action == DNF_STATE_ACTION_UNKNOWN || action == DNF_STATE_ACTION_REINSTALL)
action = DNF_STATE_ACTION_REMOVE;

/* remove start */
Expand Down Expand Up @@ -716,7 +716,7 @@ dnf_transaction_ts_progress_cb(const void *arg,

/* map to correct action code */
action = dnf_package_get_action(pkg);
if (action == DNF_STATE_ACTION_UNKNOWN)
if (action == DNF_STATE_ACTION_UNKNOWN || action == DNF_STATE_ACTION_REINSTALL)
action = DNF_STATE_ACTION_REMOVE;

dnf_state_set_package_progress(
Expand Down Expand Up @@ -1354,6 +1354,15 @@ dnf_transaction_commit(DnfTransaction *transaction, HyGoal goal, DnfState *state
g_ptr_array_unref(pkglist);
}

/* add reinstalled packages to a helper array which is used to
* map removed packages auto-added by rpm to actual DnfPackage's */
pkglist = dnf_goal_get_packages(goal, DNF_PACKAGE_INFO_REINSTALL, -1);
for (i = 0; i < pkglist->len; i++) {
pkg_tmp = static_cast< DnfPackage * >(g_ptr_array_index(pkglist, i));
g_ptr_array_add(priv->remove_helper, g_object_ref(pkg_tmp));
}
g_ptr_array_unref(pkglist);

/* this section done */
ret = dnf_state_done(state, error);
if (!ret)
Expand Down
Loading