From 3f728df888047e1f57028c9f59149f88ff403251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 27 Jun 2020 05:35:19 +0200 Subject: [PATCH] Revert "Fix updates notification on Fedora 29" The https://bugzilla.redhat.com/1650446 is fixed for enough time already (included in all supported distributions). The workaround for the bug have two issues: - may download repository metadata again - ignores various settings, including proxy, which breaks it in TemplateVM This reverts commit 8d7313b9287bc7a9c83e8face74a7c09b08e5426. --- package-managers/dnf-qubes-hooks.py | 32 +++++++++-------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/package-managers/dnf-qubes-hooks.py b/package-managers/dnf-qubes-hooks.py index 608f6cc..7da6c73 100644 --- a/package-managers/dnf-qubes-hooks.py +++ b/package-managers/dnf-qubes-hooks.py @@ -59,28 +59,16 @@ class QubesHooks(dnf.Plugin): config = self.read_config(self.base.conf) if config.getboolean('main', 'notify-updates'): - if LooseVersion(dnf.const.VERSION) > '4.0.0': - # self.base.transaction empty at this point in dnf4 - # https://bugzilla.redhat.com/1650446 - # until fixed, load the repositories again and again check for - # updates - base = dnf.Base() - base.read_all_repos() - base.fill_sack() - query = base.sack.query() - query = query.upgrades() - updates = set(query.run()) - else: - # Get all updates available _before_ this transaction - query = self.base.sack.query() - query = query.upgrades() - updates = set(query.run()) - # Get packages installed in this transaction... - just_installed = self.base.transaction - # ...and filter them out of available updates - for item in just_installed: - for pkg in item.installs(): - updates.discard(pkg) + # Get all updates available _before_ this transaction + query = self.base.sack.query() + query = query.upgrades() + updates = set(query.run()) + # Get packages installed in this transaction... + just_installed = self.base.transaction + # ...and filter them out of available updates + for item in just_installed: + for pkg in item.installs(): + updates.discard(pkg) subprocess.call([ '/usr/lib/qubes/qrexec-client-vm', 'dom0',