From 8689170368d992d9632fca7ac7b8c65a837a92bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 8 Jan 2018 01:40:18 +0100 Subject: [PATCH] dom0-updates: move PackageKit cache refresh to GUI handling PackageKit is used only by GUI updaters, refresh its cache only then. Since PackageKit daemon do not read dnf.conf, it doesn't know the right repository location, so try to access network, which results in timeouts. But at the same time, it invalidate previous cache, which is what we need. Do not delay every qubes-dom0-update call by pkcon call. --- dom0-updates/qubes-dom0-update | 2 ++ dom0-updates/qubes-receive-updates | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/dom0-updates/qubes-dom0-update b/dom0-updates/qubes-dom0-update index 6f6c1ad..486b08d 100755 --- a/dom0-updates/qubes-dom0-update +++ b/dom0-updates/qubes-dom0-update @@ -212,6 +212,8 @@ if [ -n "$PKGS" ]; then elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then # Above file exists only when at least one package was downloaded if [ "$GUI" == "1" ]; then + # refresh packagekit metadata, GUI utilities use it + pkcon refresh force $guiapp else dnf check-update diff --git a/dom0-updates/qubes-receive-updates b/dom0-updates/qubes-receive-updates index d465d8f..c8082a7 100755 --- a/dom0-updates/qubes-receive-updates +++ b/dom0-updates/qubes-receive-updates @@ -116,14 +116,6 @@ def handle_dom0updates(updatevm): # Clean old cache subprocess.call(["sudo", "/usr/bin/yum", "-q", "clean", "all"], stdout=sys.stderr) - # This will fail because of "smart" detection of no-network, - # but it will invalidate the cache - try: - null = open('/dev/null', 'w') - subprocess.call(["/usr/bin/pkcon", "refresh"], stdout=null) - null.close() - except subprocess.CalledProcessError: - pass os.umask(old_umask) exit(0)