[yum-git] yummain.py
James Antill
james at linux.duke.edu
Wed Jan 23 15:19:57 UTC 2008
yummain.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 590c5a7e3cbd7a2732a2211e46e45390dff3fb8d
Author: James Antill <james at and.org>
Date: Wed Jan 23 10:18:55 2008 -0500
Make running profiling easier, jbowes owes me a cherry coke
diff --git a/yummain.py b/yummain.py
index 13215d3..8f4d8e2 100755
--- a/yummain.py
+++ b/yummain.py
@@ -18,6 +18,7 @@
Entrance point for the yum command line interface.
"""
+import os
import sys
import locale
import logging
@@ -225,10 +226,12 @@ def print_stats(stats):
if __name__ == "__main__":
try:
- errcode = main(sys.argv[1:])
- #errcode = cprof(main, sys.argv[1:])
- #errcode = hotshot(main, sys.argv[1:])
- sys.exit(errcode)
+ if 'YUM_PROF' in os.environ:
+ if os.environ['YUM_PROF'] == 'cprof':
+ sys.exit(cprof(main, sys.argv[1:]))
+ if os.environ['YUM_PROF'] == 'hotshot':
+ sys.exit(hotshot(main, sys.argv[1:]))
+ sys.exit(main(sys.argv[1:]))
except KeyboardInterrupt, e:
print >> sys.stderr, "\n\nExiting on user cancel."
sys.exit(1)
More information about the Yum-cvs-commits
mailing list