[Zope-Checkins] CVS: Zope/inst/in - make_instance.py.in:1.1.2.3

Chris McDonough chrism@zope.com
Sun, 6 Oct 2002 17:43:22 -0400


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

Modified Files:
      Tag: chrism-install-branch
	make_instance.py.in 
Log Message:
Added support for creating NT services from instance homes.

This works by building an instance home normally and then from the
instance home running "bin\ntservice.py install".  The service is named
after the instance, and each instance can have its own service installed.

In the process, moved "zctl.py" into a "bin" directory, and moved "zope.conf"
into an "etc" directory inside an instance home.


=== Zope/inst/in/make_instance.py.in 1.1.2.2 => 1.1.2.3 ===
--- Zope/inst/in/make_instance.py.in:1.1.2.2	Sat Oct  5 22:54:42 2002
+++ Zope/inst/in/make_instance.py.in	Sun Oct  6 17:42:51 2002
@@ -20,7 +20,8 @@
 def main(zopehome, insthome, skel_dir, in_dir, config_location, user, passwd):
     make_insthome(zopehome, insthome, skel_dir, in_dir, config_location)
     write_inituser(insthome, user, passwd)
-    print 'Done!  Use "%s/zctl.py start" to start Zope.' % insthome
+    name = os.path.join(insthome, 'bin', 'zctl.py')
+    print 'Done!  Use "%s start" to start Zope.' % name
 
 def usage():
     print ("""
@@ -107,7 +108,7 @@
            'BASE_DIR':zopehome,
            'CONFIG_LOCATION':config_location}
     file_from_infile.main(os.path.join(in_dir, 'zctl.py.in'),
-                          os.path.join(insthome, 'zctl.py'), map, 0)
+                          os.path.join(insthome, 'bin', 'zctl.py'), map, 0)
 
 def write_inituser(insthome, username, passwd):
     ac_path=os.path.join(insthome, 'inituser')
@@ -145,7 +146,7 @@
     insthome = None
     user = None
     passwd = None
-    config_location = 'zope.conf'
+    config_location = None
     try:
         longopts = ["zopehome=", "insthome=", "inituser=", "help",
                     "config-location="]
@@ -184,6 +185,8 @@
         zopehome=get_zopehome(abspath(split(split(sys.argv[0])[0])[0]))
     if insthome is None:
         insthome = get_insthome(zopehome)
+    if config_location is None:
+        config_location = os.path.join(insthome, 'etc', 'zope.conf')
     if __name__ == '__main__':
         here = os.path.abspath(os.path.dirname(sys.argv[0]))
     else: