[yum-cvs] yum shell.py,1.10,1.11
Seth Vidal
skvidal at login.linux.duke.edu
Sun Mar 27 22:30:46 UTC 2005
Update of /home/groups/yum/cvs/yum
In directory login:/tmp/cvs-serv26352
Modified Files:
shell.py
Log Message:
add some limited config settings in the shell. More to go.
Index: shell.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/shell.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- shell.py 27 Mar 2005 09:22:16 -0000 1.10
+++ shell.py 27 Mar 2005 22:30:44 -0000 1.11
@@ -17,6 +17,7 @@
import os.path
import cmd
from yum import Errors
+from yum.constants import *
# TODO: implement setconfig and getconfig - this should only expose a subset
# of the configuration options. exposing all of them, especially the lists
@@ -129,6 +130,30 @@
else:
self.do_help('transaction')
+ def do_config(self, line):
+ (cmd, args, line) = self.parseline(line)
+ # ints
+ if cmd in ['debuglevel', 'errorlevel']:
+ opts = args.split()
+ if not opts:
+ self.base.log(2, '%s' % (self.base.conf.getConfigOption(cmd)))
+ else:
+ val = int(opts[0])
+ self.base.conf.setConfigOption(cmd, val)
+ # bools
+ elif cmd in ['gpgcheck', 'obsoletes', 'assumeyes']:
+ opts = args.split()
+ if not opts:
+ self.base.log(2, '%s' % (self.base.conf.getConfigOption(cmd)))
+ else:
+ value = opts[0]
+ if value.lower() not in BOOLEAN_STATES:
+ self.base.errorlog('Value %s for %s is not a Boolean' % (value, cmd))
+ return False
+ value = BOOLEAN_STATES[value.lower()]
+ self.base.conf.setConfigOption(cmd, value)
+
+
def do_repositories(self, line):
self.do_repos(line)
More information about the Yum-cvs-commits
mailing list