From fdaee4bf92cb3f1f6fd6f229a795e3216452a99e Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 4 May 2012 02:42:21 +0200 Subject: [PATCH] dom0/dom0-update: clean up metadata caches after downloading updates (#558) --- dom0/aux-tools/qubes-receive-updates | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dom0/aux-tools/qubes-receive-updates b/dom0/aux-tools/qubes-receive-updates index 366066cc..02cbebee 100755 --- a/dom0/aux-tools/qubes-receive-updates +++ b/dom0/aux-tools/qubes-receive-updates @@ -75,6 +75,15 @@ def handle_dom0updates(updatevm): subprocess.check_call(["/usr/bin/createrepo", "-q", updates_dir]) os.chown(updates_repodata_dir, -1, qubes_gid) os.chmod(updates_repodata_dir, 0775) + # Clean old cache + subprocess.call(["/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: + pass exit(0) def main():