Commit c0c1f235 authored by Chris McDonough's avatar Chris McDonough

Allow for a different skelsrc directory at install time.

parent 8ed9a76f
...@@ -20,6 +20,7 @@ Options: ...@@ -20,6 +20,7 @@ Options:
-h/--help -- print this help text -h/--help -- print this help text
-d/--dir -- the dir in which the instance home should be created -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 -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 When run without arguments, this script will ask for the information necessary
to create a Zope instance home. to create a Zope instance home.
...@@ -34,8 +35,8 @@ import copyzopeskel ...@@ -34,8 +35,8 @@ import copyzopeskel
def main(): def main():
try: try:
opts, args = getopt.getopt(sys.argv[1:], opts, args = getopt.getopt(sys.argv[1:],
"hu:z:d:s:z:l:i:o:g:c:", "hu:d:s:",
["help", "user=", "dir="] ["help", "user=", "dir=", "skelsrc="]
) )
except getopt.GetoptError, msg: except getopt.GetoptError, msg:
usage(sys.stderr, msg) usage(sys.stderr, msg)
...@@ -45,6 +46,7 @@ def main(): ...@@ -45,6 +46,7 @@ def main():
user = None user = None
password = None password = None
skeltarget = None skeltarget = None
skelsrc = None
for opt, arg in opts: for opt, arg in opts:
if opt in ("-d", "--dir"): if opt in ("-d", "--dir"):
...@@ -52,6 +54,11 @@ def main(): ...@@ -52,6 +54,11 @@ def main():
if not skeltarget: if not skeltarget:
usage(sys.stderr, "dir must not be empty") usage(sys.stderr, "dir must not be empty")
sys.exit(2) 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"): if opt in ("-h", "--help"):
usage(sys.stdout) usage(sys.stdout)
sys.exit() sys.exit()
...@@ -76,7 +83,9 @@ def main(): ...@@ -76,7 +83,9 @@ def main():
zopehome = os.path.dirname(os.path.dirname(script)) zopehome = os.path.dirname(os.path.dirname(script))
softwarehome = os.path.join(zopehome, "lib", "python") softwarehome = os.path.join(zopehome, "lib", "python")
configfile = os.path.join(instancehome, 'etc', 'zope.conf') 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") inituser = os.path.join(instancehome, "inituser")
if not (user or os.path.exists(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