Skip to content

Commit

Permalink
[minor] Do not replace reasons when it is identical
Browse files Browse the repository at this point in the history
It will replace a reason when original reason had lower priority.
  • Loading branch information
j-mracek authored and pkratoch committed Nov 22, 2019
1 parent 8d918d9 commit 5ccde9f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dnf/base.py
Expand Up @@ -646,13 +646,14 @@ def _goal2transaction(self, goal):

if pkg in installonly_query:
reason_installonly = ts.get_reason(pkg)
if libdnf.transaction.TransactionItemReasonCompare(reason, reason_installonly) < 1:
if libdnf.transaction.TransactionItemReasonCompare(
reason, reason_installonly) == -1:
reason = reason_installonly

# inherit the best reason from obsoleted packages
for obsolete in obs:
reason_obsolete = ts.get_reason(obsolete)
if libdnf.transaction.TransactionItemReasonCompare(reason, reason_obsolete) < 1:
if libdnf.transaction.TransactionItemReasonCompare(reason, reason_obsolete) == -1:
reason = reason_obsolete

ts.add_install(pkg, obs, reason)
Expand Down

0 comments on commit 5ccde9f

Please sign in to comment.