[yum-cvs] yum shell.py,1.11,1.12

Seth Vidal skvidal at login.linux.duke.edu
Mon Mar 28 00:08:25 UTC 2005


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

Modified Files:
	shell.py 
Log Message:

implement some config options that involve the least amount of pain


Index: shell.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/shell.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- shell.py	27 Mar 2005 22:30:44 -0000	1.11
+++ shell.py	28 Mar 2005 00:08:23 -0000	1.12
@@ -60,7 +60,7 @@
             try:
                 self.base.parseCommands()
             except Errors.YumBaseError:
-                pass
+                self.do_help('')
             else:
                 self.base.doCommands()
     
@@ -136,15 +136,24 @@
         if cmd in ['debuglevel', 'errorlevel']:
             opts = args.split()
             if not opts:
-                self.base.log(2, '%s' % (self.base.conf.getConfigOption(cmd)))
+                self.base.log(2, '%s: %s' % (cmd, self.base.conf.getConfigOption(cmd)))
             else:
-                val = int(opts[0])
+                val = opts[0]
+                try:
+                    val = int(val)
+                except ValueError, e:
+                    self.base.errorlog('Value %s for %s cannot be made to an int' % (val, cmd))
+                    return
                 self.base.conf.setConfigOption(cmd, val)
+                if cmd == 'debuglevel':
+                    self.base.log.threshold = val
+                elif cmd == 'errorlevel':
+                    self.base.errorlog.threshold = val
         # bools
         elif cmd in ['gpgcheck', 'obsoletes', 'assumeyes']:
             opts = args.split()
             if not opts:
-                self.base.log(2, '%s' % (self.base.conf.getConfigOption(cmd)))
+                self.base.log(2, '%s: %s' % (cmd, self.base.conf.getConfigOption(cmd)))
             else:
                 value = opts[0]
                 if value.lower() not in BOOLEAN_STATES:
@@ -152,6 +161,10 @@
                     return False
                 value = BOOLEAN_STATES[value.lower()]
                 self.base.conf.setConfigOption(cmd, value)
+                if cmd == 'obsoletes':
+                    if hasattr(self.base, 'up'): # reset the updates
+                        del self.base.up
+
 
             
     def do_repositories(self, line):




More information about the Yum-cvs-commits mailing list