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

Chris McDonough chrism@zope.com
Sat, 12 Oct 2002 16:29:05 -0400


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

Modified Files:
      Tag: chrism-install-branch
	make_instance.py.in 
Log Message:
RPM install now creates an instance_home (in /var/opt/zope).

Changes to initial user stuff based on requirements for RPM install.


=== Zope/inst/in/make_instance.py.in 1.1.2.4 => 1.1.2.5 ===
--- Zope/inst/in/make_instance.py.in:1.1.2.4	Tue Oct  8 19:15:54 2002
+++ Zope/inst/in/make_instance.py.in	Sat Oct 12 16:28:34 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)
+    if not (user is None or password is None):
+        write_inituser(insthome, user, passwd)
     name = os.path.join(insthome, 'bin', 'zctl.py')
     print 'Done!  Use "%s start" to start Zope.' % name
 
@@ -33,10 +34,14 @@
     print
     print "    --insthome         specifies instance home target directory"
     print "    --zopehome         specifies location of Zope software"
-    print "    --inituser         specifies username and password for"
-    print "                       inituser file written to insthome"
+    print "    --inituser         specifies username and password in the form"
+    print "                       'username:password' to use for the"
+    print "                       inituser file written to insthome.  If the"
+    print "                       value of --inituser is a null value, its"
+    print "                       value is not gathered interactively and an "
+    print "                       inituser file is not written to insthome."
     print "    --config-location  specifies configuration file location"
-    print "                       (default: 'zope.conf')"
+    print "                       (default: 'INSTANCE_HOME/etc/zope.conf')"
     print "  If 'zopehome', 'insthome', or 'inituser' are not specified as"
     print "  options, they are gathered interactively."
 
@@ -147,6 +152,7 @@
     insthome = None
     user = None
     passwd = None
+    write_inituser = 1
     config_location = None
     try:
         longopts = ["zopehome=", "insthome=", "inituser=", "help",
@@ -165,6 +171,9 @@
         if o == '--insthome':
             insthome = os.path.abspath(os.path.expanduser(a))
         if o == '--inituser':
+            if a == '':
+                write_inituser = 0
+                continue
             tup=a.split(':', 1)
             msg = ('--inituser must be specified in the format'
                    ' "username:password"')
@@ -192,8 +201,9 @@
         here = os.path.abspath(os.path.dirname(sys.argv[0]))
     else:
         here = os.path.abspath(os.path.dirname(__file__))
-    if user is None or passwd is None:
-        user, passwd = get_inituser(zopehome, insthome)
+    if write_inituser:
+        if user is None or passwd is None:
+            user, passwd = get_inituser(zopehome, insthome)
     # guess about skeleton and in directories.
     skel_dir = os.path.join(here, 'skel')
     in_dir = os.path.join(here, 'in')