summaryrefslogtreecommitdiffstats
path: root/yuminstall.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2008-04-15 12:33:45 -0400
committerJeremy Katz <katzj@redhat.com>2008-04-15 12:33:45 -0400
commit66e5cd413cad1f5f605daa05bf4986a928e3e47b (patch)
tree72a14b2a1a4357fb37c2277e54b69cb1751ab79a /yuminstall.py
parent15375cfe75efa1a05acf1abd60d09cecff07f365 (diff)
downloadanaconda-66e5cd413cad1f5f605daa05bf4986a928e3e47b.tar.gz
anaconda-66e5cd413cad1f5f605daa05bf4986a928e3e47b.tar.xz
anaconda-66e5cd413cad1f5f605daa05bf4986a928e3e47b.zip
Expire yum caches on upgrade (#374921)
Ensure that we expire yum caches after an upgrade so that people don't end up still pulling from the old repos
Diffstat (limited to 'yuminstall.py')
-rw-r--r--yuminstall.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/yuminstall.py b/yuminstall.py
index a815e5554..f594cccfe 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1557,6 +1557,15 @@ class YumBackend(AnacondaBackend):
if os.path.exists("%s/tmp/cache" % anaconda.rootPath):
shutil.rmtree("%s/tmp/cache" % anaconda.rootPath)
+ # expire yum caches on upgrade
+ if anaconda.id.getUpgrade() and os.path.exists("%s/var/cache/yum" %(anaconda.rootPath,)):
+ log.info("Expiring yum caches")
+ for d in "%s/var/cache/yum" %(anaconda.rootPath,):
+ try:
+ os.unlink("%s/var/cache/yum/%s/cachecookie" %(anaconda.rootPath, d)):
+ except:
+ pass
+
# XXX: write proper lvm config
AnacondaBackend.doPostInstall(self, anaconda)