[Yum-devel] [PATCH 1/2] yum -C should use the system cachedir.

Zdeněk Pavlas zpavlas at redhat.com
Tue Apr 17 12:34:20 UTC 2012


<documentation>
--cacheonly
If you're using this as a user yum will not use the tempcache for
the user but will only use the system cache in the system cachedir.
</documentation>

setCacheDir() sets up the user tempcache when UID != 0.
Thus, we should avoid calling it with --cacheonly.
---
 cli.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/cli.py b/cli.py
index afa7447..d9d6a4b 100755
--- a/cli.py
+++ b/cli.py
@@ -1916,9 +1916,7 @@ class YumOptionParser(OptionParser):
                 self.base.conf.assumeno  = 1
 
             #  Treat users like root as much as possible:
-            if not self.base.setCacheDir():
-                self.base.conf.cache = 1
-            if opts.cacheonly:
+            if opts.cacheonly or not self.base.setCacheDir():
                 self.base.conf.cache = 1
 
             if opts.obsoletes:
-- 
1.7.4.4



More information about the Yum-devel mailing list