[yum-cvs] yum/yum config.py,1.105.2.6,1.105.2.7

Tim Lauridsen timlau at linux.duke.edu
Tue Apr 17 09:55:08 UTC 2007


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv30925/yum

Modified Files:
      Tag: yum-3_0_X
	config.py 
Log Message:
Fixed the baseconf write method so it:
* dont causes a Traceback.
* booleans are saved as "0" & "1", insted of "yes" & "no"
* Save all options read by the ConfigParser also if the values are default values.
* saves "option=value", insted of 'option = value'

Index: config.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/config.py,v
retrieving revision 1.105.2.6
retrieving revision 1.105.2.7
diff -u -r1.105.2.6 -r1.105.2.7
--- config.py	31 Jan 2007 01:53:50 -0000	1.105.2.6
+++ config.py	17 Apr 2007 09:55:06 -0000	1.105.2.7
@@ -223,9 +223,9 @@
 
     def tostring(self, value):
         if value:
-            return "yes"
+            return "1"
         else:
-            return "no"
+            return "0"
 
 class FloatOption(Option):
     def parse(self, s):
@@ -423,13 +423,13 @@
             section = self._section
 
         fileobj.write('[%s]\n' % section)
-
+        # get options in ConfigParser object
+        cfgOptions = self.cfg.options(section)
         # Write options
         for name, value in self.iteritems():
             option = self.optionobj(name)
-
-            if always is None or name in always or option.default != value:
-                fileobj.write("%s = %s\n" % (name, option.tostring(value)))
+            if always is None or name in always or option.default != value or name in cfgOptions :
+                fileobj.write("%s=%s\n" % (name, option.tostring(value)))
 
     def getConfigOption(self, option, default=None):
         warnings.warn('getConfigOption() will go away in a future version of Yum.\n'




More information about the Yum-cvs-commits mailing list