On Thu, 2005-12-01 at 12:11 -0500, Jeff Spaleta wrote: > On 12/1/05, Jose' Matos <jamatos@xxxxxxxx> wrote: > > This will go no matter how repositories I disable. Is this a bug or a new way > > to deal with it in 2.4.1? > > this test version of yum has a new cache feature to cache > repodata..for a period of time. > Go into your yum cache directory and look for cachecookie files for each repo. > > The clean all is NOT cleaning out the cookie files.. which are > controlling the timeout based caching feature. This is a bug... you > need to file it. The attached patch adds 'clean cookies' operation + cleans them on 'yum clean all' operation as well. Didn't commit to yum cvs yet since I started wondering do we really want to call them "cookies" in the user interface? - Panu -
Index: cli.py =================================================================== RCS file: /home/groups/yum/cvs/yum/cli.py,v retrieving revision 1.189 diff -u -r1.189 cli.py --- cli.py 14 Jul 2005 08:32:51 -0000 1.189 +++ cli.py 1 Dec 2005 17:46:03 -0000 @@ -398,7 +398,7 @@ self.errorlog(0, _('Error: clean requires an option: headers, packages, cache, metadata, all')) for cmd in self.extcmds: - if cmd not in ['headers', 'packages', 'metadata', 'cache', 'dbcache', 'all']: + if cmd not in ['headers', 'packages', 'metadata', 'cache', 'dbcache', 'cookies', 'all']: self.usage() raise CliError @@ -1267,9 +1267,10 @@ xmlcode, xmlresults = self.cleanMetadata() dbcode, dbresults = self.cleanSqlite() piklcode, piklresults = self.cleanPickles() + ckcode, ckresults = self.cleanCookies() - code = hdrcode + pkgcode + xmlcode + piklcode + dbcode - results = hdrresults + pkgresults + xmlresults + piklresults + dbresults + code = hdrcode + pkgcode + xmlcode + piklcode + dbcode + ckcode + results = hdrresults + pkgresults + xmlresults + piklresults + dbresults + ckresults for msg in results: self.log(2, msg) return code, [] @@ -1289,9 +1290,12 @@ if 'dbcache' in self.extcmds: self.log(2, 'Cleaning up database cache') dbcode, dbresults = self.cleanSqlite() + if 'cookies' in self.extcmds: + self.log(2, 'Cleaning up cache cookies') + ckcode, ckresults = self.cleanCookies() - code = hdrcode + pkgcode + xmlcode + piklcode + dbcode - results = hdrresults + pkgresults + xmlresults + piklresults + dbresults + code = hdrcode + pkgcode + xmlcode + piklcode + dbcode + ckcode + results = hdrresults + pkgresults + xmlresults + piklresults + dbresults+ ckresults for msg in results: self.log(2, msg) return code, [] Index: yum/__init__.py =================================================================== RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v retrieving revision 1.135.2.3 diff -u -r1.135.2.3 __init__.py --- yum/__init__.py 30 Nov 2005 20:04:26 -0000 1.135.2.3 +++ yum/__init__.py 1 Dec 2005 17:46:04 -0000 @@ -858,6 +858,31 @@ msg = '%d metadata files removed' % removed return 0, [msg] + def cleanCookies(self): + filelist = [] + exts = ['cachecookie'] + + removed = 0 + for ext in exts: + for repo in self.repos.listEnabled(): + repo.dirSetup() + path = repo.cachedir + filelist = misc.getFileList(path, ext, filelist) + + for item in filelist: + try: + os.unlink(item) + except OSError, e: + self.errorlog(0, 'Cannot remove cookie file %s' % item) + continue + else: + self.log(7, 'cookie file %s removed' % item) + removed+=1 + msg = '%d cookie files removed' % removed + return 0, [msg] + + + def sortPkgObj(self, pkg1 ,pkg2): """sorts a list of package tuples by name""" if pkg1.name > pkg2.name:
-- fedora-test-list mailing list fedora-test-list@xxxxxxxxxx To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-test-list