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