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.
This commit is contained in:
parent
6c8537fab1
commit
8689170368
@ -212,6 +212,8 @@ if [ -n "$PKGS" ]; then
|
|||||||
elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then
|
elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then
|
||||||
# Above file exists only when at least one package was downloaded
|
# Above file exists only when at least one package was downloaded
|
||||||
if [ "$GUI" == "1" ]; then
|
if [ "$GUI" == "1" ]; then
|
||||||
|
# refresh packagekit metadata, GUI utilities use it
|
||||||
|
pkcon refresh force
|
||||||
$guiapp
|
$guiapp
|
||||||
else
|
else
|
||||||
dnf check-update
|
dnf check-update
|
||||||
|
@ -116,14 +116,6 @@ def handle_dom0updates(updatevm):
|
|||||||
# Clean old cache
|
# Clean old cache
|
||||||
subprocess.call(["sudo", "/usr/bin/yum", "-q", "clean", "all"],
|
subprocess.call(["sudo", "/usr/bin/yum", "-q", "clean", "all"],
|
||||||
stdout=sys.stderr)
|
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)
|
os.umask(old_umask)
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user