33 |
|
|
34 |
prefix = ARGUMENTS.get('prefix', Dir('#.').abspath) |
prefix = ARGUMENTS.get('prefix', Dir('#.').abspath) |
35 |
|
|
36 |
# Read configuration options from file scons/<hostname>_options.py |
#Determine where to read options from use: |
37 |
hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0]) |
#1. command line |
38 |
ehostname = scons_extensions.effectiveName(hostname) |
#2. scons/<hostname>_options.py |
39 |
tmp = os.path.join("scons",ehostname+"_options.py") |
#3. name as part of a cluster |
40 |
options_file = ARGUMENTS.get('options_file', tmp) |
options_file=ARGUMENTS.get('options_file', None) |
41 |
|
if not options_file: |
42 |
|
hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0]) |
43 |
|
options_file = os.path.join("scons",hostname+"_options.py") |
44 |
|
#If there is no options file with that name see if there is a substitute |
45 |
|
if not os.path.isfile(options_file): |
46 |
|
tmp = scons_extensions.effectiveName(hostname) |
47 |
|
options_file = os.path.join("scons",tmp+"_options.py") |
48 |
|
|
49 |
if not os.path.isfile(options_file): |
if not os.path.isfile(options_file): |
50 |
|
print "Options file not found (expected '%s')" % options_file |
51 |
options_file = False |
options_file = False |
|
print "Options file not found (expected '%s')" % tmp |
|
52 |
else: |
else: |
53 |
print "Options file is", options_file |
print "Options file is", options_file |
54 |
|
|