author | berghofe |
Sun, 15 May 2005 21:04:10 +0200 | |
changeset 15961 | 24c6b96b4a2f |
parent 15849 | a2c8160b58fd |
child 15972 | 8ac3803c8f73 |
permissions | -rw-r--r-- |
11553 | 1 |
# -*- shell-script -*- |
2307 | 2 |
# $Id$ |
9789 | 3 |
# Author: Markus Wenzel, TU Muenchen |
2299
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
4 |
# |
2348 | 5 |
# getsettings - bash source script to augment current env. |
2299
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
6 |
# |
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
7 |
|
7770
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
8 |
if [ -z "$ISABELLE_SETTINGS_PRESENT" ] |
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
9 |
then |
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
10 |
|
3185 | 11 |
set -o allexport |
12 |
||
7770
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
13 |
ISABELLE_SETTINGS_PRESENT=true |
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
14 |
|
2736 | 15 |
#normalize ISABELLE_HOME as passed by caller |
15849 | 16 |
ISABELLE_HOME=$(cd "$ISABELLE_HOME"; pwd) |
12598 | 17 |
if { echo -n "$ISABELLE_HOME" | fgrep " " >/dev/null; } |
18 |
then |
|
19 |
echo 1>&2 "### White space in ISABELLE_HOME may cause strange problems later on!" |
|
20 |
echo 1>&2 "### ISABELLE_HOME=\"$ISABELLE_HOME\"" |
|
21 |
fi |
|
2736 | 22 |
|
11553 | 23 |
#key executables |
24 |
ISABELLE="$ISABELLE_HOME/bin/isabelle-process" |
|
9789 | 25 |
ISATOOL="$ISABELLE_HOME/bin/isatool" |
2299
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
26 |
|
2643 | 27 |
#users tend to put strange things in here ... |
2621 | 28 |
unset ENV |
29 |
unset BASH_ENV |
|
30 |
||
9680 | 31 |
#support easy settings |
32 |
function choosefrom () |
|
33 |
{ |
|
34 |
local RESULT="" |
|
35 |
local FILE="" |
|
36 |
||
37 |
for FILE in "$@" |
|
38 |
do |
|
39 |
[ -z "$RESULT" -a -e "$FILE" ] && RESULT="$FILE" |
|
40 |
done |
|
41 |
||
42 |
[ -z "$RESULT" ] && RESULT="$FILE" |
|
43 |
echo "$RESULT" |
|
44 |
} |
|
45 |
||
2643 | 46 |
#get actual settings |
9789 | 47 |
. "$ISABELLE_HOME/etc/settings" || exit 2 |
9227 | 48 |
ISABELLE_SITE_SETTINGS_PRESENT=true |
9789 | 49 |
|
50 |
[ "$ISABELLE_HOME" -ef "$ISABELLE_HOME_USER" ] && \ |
|
51 |
{ echo >&2 "### ISABELLE_HOME and ISABELLE_HOME_USER should not be the same directory!"; } |
|
52 |
[ -f "$ISABELLE_HOME_USER/etc/settings" ] && . "$ISABELLE_HOME_USER/etc/settings" |
|
2299
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
53 |
|
6413 | 54 |
#append ML system identifier to paths |
55 |
if [ -z "$ML_PLATFORM" ]; then |
|
56 |
ML_IDENTIFIER="$ML_SYSTEM" |
|
57 |
else |
|
58 |
ML_IDENTIFIER="${ML_SYSTEM}_${ML_PLATFORM}" |
|
59 |
fi |
|
60 |
ISABELLE_OUTPUT="$ISABELLE_OUTPUT/$ML_IDENTIFIER" |
|
3118 | 61 |
|
2299
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
62 |
set +o allexport |
7770
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
63 |
|
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
64 |
fi |