[Zope-Checkins] CVS: Zope/inst - acceptable_version.py:1.1.2.2 register_software.py:1.1.2.3

Matt Behrens matt@zigg.com
Mon, 27 May 2002 18:58:33 -0400


Update of /cvs-repository/Zope/inst
In directory cvs.zope.org:/tmp/cvs-serv18365/inst

Modified Files:
      Tag: zigg_unix-install-control-config-branch
	acceptable_version.py register_software.py 
Log Message:
More progress:

- Rewrite the control script to not have any special knowledge of
  'create', to help maintain the divorce from what the software home's
  control package does.

- Add ZOPE_HOME, now that it's needed (to look at the default imports).

- A few more portability fixes (now working on Linux).

- Start to option-enable z2.py, though there is no code yet.



=== Zope/inst/acceptable_version.py 1.1.2.1 => 1.1.2.2 ===
 
 version = string.split(sys.version, ' ')[0]
-print version
+print '%s is %s' % (sys.executable, version)
 
 supported_version = sys.argv[1]
 minimum_patchlevel = sys.argv[2]


=== Zope/inst/register_software.py 1.1.2.2 => 1.1.2.3 ===
 """
 
-import ConfigParser, os, sys
+from ConfigParser import ConfigParser
+import os, sys
 
 def registerAsDefault(system_conf, software_name):
-    if not system_conf.has_section('defaults'):
-        system_conf.add_section('defaults')
-    system_conf.set('defaults', 'software', software_name)
+    if not system_conf.has_section('Defaults'):
+        system_conf.add_section('Defaults')
+    system_conf.set('Defaults', 'software', software_name)
 
 config_dir = sys.argv[1]
 software_name = sys.argv[2]
@@ -28,24 +29,24 @@
 register_default = int(sys.argv[4])
 
 system_conf_name = os.path.join(config_dir, 'system.conf')
-system_conf = ConfigParser.ConfigParser()
+system_conf = ConfigParser()
 system_conf.read(system_conf_name)
 
-if not system_conf.has_section('software_homes'):
-    system_conf.add_section('software_homes')
-system_conf.set('software_homes', software_name, software_home)
+if not system_conf.has_section('Software'):
+    system_conf.add_section('Software')
+system_conf.set('Software', software_name, software_home)
 
 if register_default:
     # Unconditionally register as default
     registerAsDefault(system_conf, software_name)
 else:
     # Only register if no default exists
-    if not system_conf.has_option('defaults', 'software'):
+    if not system_conf.has_option('Defaults', 'software'):
 	registerAsDefault(system_conf, software_name)
 
 # Also register a default instance name if it does not exist
-if not system_conf.has_option('defaults', 'instance'):
-    system_conf.set('defaults', 'instance', 'default')
+if not system_conf.has_option('Defaults', 'instance'):
+    system_conf.set('Defaults', 'instance', 'default')
 
 f = open(system_conf_name, 'w')
 system_conf.write(f)