diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py index a9a95bf..cfacafe 100644 --- a/python/dnfdaemon/server/__init__.py +++ b/python/dnfdaemon/server/__init__.py @@ -39,6 +39,7 @@ import dnf.yum import functools import hawkey +import libdnf import json import logging import operator @@ -853,7 +854,7 @@ def _get_transaction(self): out_list = [] sublist = [] tx_list = {} - for t in ('downgrade', 'remove', 'install', 'reinstall', 'update'): + for t in ('downgrade', 'remove', 'install', 'weak-deps', 'reinstall', 'update'): tx_list[t] = [] replaces = {} @@ -872,7 +873,10 @@ def _get_transaction(self): elif tsi.action == dnf.transaction.PKG_ERASE: tx_list['remove'].append(tsi) elif tsi.action == dnf.transaction.PKG_INSTALL: - tx_list['install'].append(tsi) + if tsi.reason == libdnf.transaction.TransactionItemReason_WEAK_DEPENDENCY: + tx_list['weak-deps'].append(tsi) + else: + tx_list['install'].append(tsi) elif tsi.action == dnf.transaction.PKG_REINSTALL: tx_list['reinstall'].append(tsi) elif tsi.action == dnf.transaction.PKG_UPGRADE: @@ -880,6 +884,7 @@ def _get_transaction(self): # build action tree for (action, pkglist) in [ ('install', tx_list['install']), + ('weak-deps', tx_list['weak-deps']), ('update', tx_list['update']), ('remove', tx_list['remove']), ('reinstall', tx_list['reinstall']), @@ -1078,7 +1083,7 @@ def _get_id(self, pkg): if callable(pkg.ui_from_repo): values = [pkg.name, str(pkg.epoch), pkg.version, pkg.release, pkg.arch, pkg.ui_from_repo()] else: - values = [pkg.name, str(pkg.epoch), pkg.version, pkg.release, pkg.arch, pkg.ui_from_repo] + values = [pkg.name, str(pkg.epoch), pkg.version, pkg.release, pkg.arch, pkg.ui_from_repo] return ",".join(values) def _get_action(self, po):