Bug 486555

Summary: Need to be able to clean/disable yum cache
Product: [Retired] Fedora Hosted Projects Reporter: Richard W.M. Jones <rjones>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: dcantrell
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-03 22:44:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2009-02-20 09:49:55 UTC
Description of problem:

Mock (and yum in general) has an annoying habit of caching repository state,
and not doing a trivial 'HTTP HEAD' request to find out if its cache needs to be
expired.

This is particularly a problem for smock because we rerun 'createrepo' between
each run of mock, but the yum inside the mock keeps getting the old state of
the repository.

It appears that the cache is stored in /var/lib/mock/cache/.../yum_cache/
Unfortunately it is owned by root and so a simple 'rm -r' fails for us.

Therefore we need a mock command to blow away this cache.  For smock it
is not useful since the webserver runs on localhost so it's just as easy to fetch
the repodata and RPMs each time.

Version-Release number of selected component (if applicable):

0.9.14

How reproducible:

About 50% of the time.

Steps to Reproduce:
1. Run mock
2. Run createrepo on some repo used by mock
3. Run mock again
4. Observe that sometimes old repodata is used

Comment 1 Richard W.M. Jones 2009-02-20 10:09:48 UTC
There seems to be a second cache here:
/var/cache/mock/*/yum_cache/
Different from the first one, also needs to be rm -rf'd

Comment 2 Clark Williams 2009-02-20 15:00:40 UTC
mock 0.9.14 changed the mock cache directory from /var/lib/mock/cache to /var/cache/mock. The /var/lib/mock/cache dir needs to be whacked entirely. 

I'm not sure what mock can do about the repodata. We use yum for any access to repositories.

Comment 3 Clark Williams 2010-08-03 22:20:48 UTC
mock-1.1.3 coming out with --scrub option which allows you to clean the yum cache.

Comment 4 Fedora Update System 2010-08-07 23:23:38 UTC
mock-1.1.3-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.