[Zope-Checkins] CVS: Zope/utilities - mkzopeinstance.py:1.6

Chris McDonough chrism at zope.com
Fri Aug 15 20:53:55 EDT 2003


Update of /cvs-repository/Zope/utilities
In directory cvs.zope.org:/tmp/cvs-serv12492

Modified Files:
	mkzopeinstance.py 
Log Message:

Allow for a different skelsrc directory at install time.


=== Zope/utilities/mkzopeinstance.py 1.5 => 1.6 ===
--- Zope/utilities/mkzopeinstance.py:1.5	Thu Jul 24 15:58:16 2003
+++ Zope/utilities/mkzopeinstance.py	Fri Aug 15 19:53:49 2003
@@ -20,6 +20,7 @@
 -h/--help -- print this help text
 -d/--dir  -- the dir in which the instance home should be created
 -u/--user NAME:PASSWORD -- set the user name and password of the initial user
+-s/--skelsrc -- the dir from which skeleton files should be copied
 
 When run without arguments, this script will ask for the information necessary
 to create a Zope instance home.
@@ -34,8 +35,8 @@
 def main():
     try:
         opts, args = getopt.getopt(sys.argv[1:],
-            "hu:z:d:s:z:l:i:o:g:c:",
-            ["help", "user=", "dir="]
+            "hu:d:s:",
+            ["help", "user=", "dir=", "skelsrc="]
             )
     except getopt.GetoptError, msg:
         usage(sys.stderr, msg)
@@ -45,6 +46,7 @@
     user = None
     password = None
     skeltarget = None
+    skelsrc = None
 
     for opt, arg in opts:
         if opt in ("-d", "--dir"):
@@ -52,6 +54,11 @@
             if not skeltarget:
                 usage(sys.stderr, "dir must not be empty")
                 sys.exit(2)
+        if opt in ("-s", "--skelsrc"):
+            skelsrc = os.path.abspath(os.path.expanduser(arg))
+            if not skelsrc:
+                usage(sys.stderr, "skelsrc must not be empty")
+                sys.exit(2)
         if opt in ("-h", "--help"):
             usage(sys.stdout)
             sys.exit()
@@ -76,7 +83,9 @@
     zopehome = os.path.dirname(os.path.dirname(script))
     softwarehome = os.path.join(zopehome, "lib", "python")
     configfile = os.path.join(instancehome, 'etc', 'zope.conf')
-    skelsrc = os.path.join(zopehome, "skel")
+    if skelsrc is None:
+        # default to using stock Zope skeleton source
+        skelsrc = os.path.join(zopehome, "skel")
 
     inituser = os.path.join(instancehome, "inituser")
     if not (user or os.path.exists(inituser)):




More information about the Zope-Checkins mailing list