Commit c0c1f235 authored by Chris McDonough's avatar Chris McDonough

parent 8ed9a76f
......@@ -20,6 +20,7 @@ Options:
-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 @@ import copyzopeskel
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 @@ def main():
user = None
password = None
skeltarget = None
skelsrc = None
for opt, arg in opts:
if opt in ("-d", "--dir"):
......@@ -52,6 +54,11 @@ def main():
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 @@ def main():
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)):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment