[yum-cvs] yum-utils repo-rss.py,1.2,1.3

Panu Matilainen pmatilai at login.linux.duke.edu
Wed Jul 13 09:33:47 UTC 2005


Update of /home/groups/yum/cvs/yum-utils
In directory login:/tmp/cvs-serv25930

Modified Files:
	repo-rss.py 
Log Message:
Add tempcache support to repo-rss.


Index: repo-rss.py
===================================================================
RCS file: /home/groups/yum/cvs/yum-utils/repo-rss.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- repo-rss.py	22 Mar 2005 14:10:53 -0000	1.2
+++ repo-rss.py	13 Jul 2005 09:33:45 -0000	1.3
@@ -17,13 +17,13 @@
 
 import yum
 import yum.Errors
+from yum.misc import getCacheDir
 import sys
 import os
 import libxml2
 import time
 from optparse import OptionParser
 
-
 class YumQuiet(yum.YumBase):
     def __init__(self):
         yum.YumBase.__init__(self)
@@ -174,9 +174,12 @@
     repoids = args
     my = YumQuiet()
     my.doConfigSetup()
-    if os.geteuid() != 0:
-        my.conf.setConfigOption('cache', 1)
-        print 'Not running as root, might not be able to import all of cache'
+    if os.geteuid() != 0 or options.tempcache:
+        cachedir = getCacheDir()
+        if cachedir is None:
+            print "Error: Could not make cachedir, exiting"
+            sys.exit(50)
+        my.repos.setCacheDir(cachedir)
 
     if len(repoids) > 0:
         for repo in my.repos.repos.values():
@@ -236,6 +239,9 @@
                       help='description of feed: %default')
     parser.add_option('-r', action='store', type='int', dest='days', default=3,
                       help='most recent (in days): %default')
+    parser.add_option("--tempcache", default=False, action="store_true",
+                      help="Use a temp dir for storing/accessing yum-cache")
+
     (options, args) = parser.parse_args()
 
     main(options, args)




More information about the Yum-cvs-commits mailing list