Commit 572fe170 authored by Ken Manheimer's avatar Ken Manheimer

Produce a relocatable start script - it sets PYTHONHOME to the

directory where it resides, and expects z2.py to be there.  This way,
the entire installed site can be moved to another directory, and the
start script will continue to do the right thing.  (I don't know what
else has the location coded in - if it all keys off of PYTHONPATH,
then this may be enough...)
parent d6d04ede
......@@ -87,17 +87,17 @@ import sys, os
from do import *
def sh(home, user, group):
z2=os.path.join(home, 'z2.py')
start=os.path.join(home, 'start')
if not os.path.exists(start):
print '-'*78
print 'Creating start script, start'
open(start,'w').write(
"#! /bin/sh\n"
"PYTHONHOME=%s\n"
"reldir=`dirname $0`\n"
"PYTHONHOME=`cd $reldir; pwd`\n"
"export PYTHONHOME\n"
'exec %s \\\n %s \\\n -D "$@"\n'
% (home, sys.executable, z2))
'exec %s \\\n $PYTHONHOME/z2.py \\\n -D "$@"\n'
% sys.executable)
ch(start,user,group,0711)
stop=os.path.join(home, 'stop')
......
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