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

Fixes for RHEL-15902 #2085

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
Fix handling installonly packages reasons
Upstream commit: a4d815e

The original code took the first item from all remaining packages.
It means a random reason and use it to keep installonly package reason.

Related: https://issues.redhat.com/browse/RHEL-15902
Closes: #2061
  • Loading branch information
j-mracek authored and ppisar committed Apr 23, 2024
commit 186be49c70dfdf0eae71cbd9c0e3e9ecc09a5ef2
6 changes: 4 additions & 2 deletions dnf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,9 +815,11 @@ def _goal2transaction(self, goal):
if erasures:
remaining_installed_query = self.sack.query(flags=hawkey.IGNORE_EXCLUDES).installed()
remaining_installed_query.filterm(pkg__neq=erasures)
remaining_installed_query.apply()
for pkg in erasures:
if remaining_installed_query.filter(name=pkg.name):
remaining = remaining_installed_query[0]
tmp_remaining_installed_query = remaining_installed_query.filter(name=pkg.name, arch=pkg.arch)
if tmp_remaining_installed_query:
remaining = tmp_remaining_installed_query[0]
ts.get_reason(remaining)
self.history.set_reason(remaining, ts.get_reason(remaining))
self._ds_callback.pkg_added(pkg, 'e')
Expand Down