[yum-commits] yum-debug-dump.py

James Antill james at osuosl.org
Fri Jan 30 15:19:23 UTC 2009


 yum-debug-dump.py |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit c87af80f9beefa7e77a5db788446b5343004da54
Author: James Antill <james at and.org>
Date:   Fri Jan 30 10:19:13 2009 -0500

    Allow yum-debug-dump to work as non-root

diff --git a/yum-debug-dump.py b/yum-debug-dump.py
index 1797026..65e706c 100644
--- a/yum-debug-dump.py
+++ b/yum-debug-dump.py
@@ -156,6 +156,20 @@ class YumDebugDump(yum.YumBase):
 def main():
     my = YumDebugDump()
     my.doConfigSetup(init_plugins=True)
+
+    # make yum-debug-dump work as non root user.
+    if my.conf.uid != 0:
+        cachedir = getCacheDir()
+        if cachedir is None:
+            self.logger.error("Error: Could not make cachedir, exiting")
+            sys.exit(50)
+        my.repos.setCacheDir(cachedir)
+
+        # Turn off cache
+        my.conf.cache = 0
+        # make sure the repos know about it, too
+        my.repos.setCache(0)
+
     fn = my.create_debug_file()
     print "Output written to: %s" % fn
 


More information about the Yum-commits mailing list