lib/scripts/getsettings
author wenzelm
Tue, 13 Feb 2001 16:31:18 +0100
changeset 11109 ce1cefc6c14c
parent 9789 7e5e6c47c0b5
child 11553 87b585079d01
permissions -rw-r--r--
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2307
508d2a233dbc *** empty log message ***
wenzelm
parents: 2299
diff changeset
     1
#
508d2a233dbc *** empty log message ***
wenzelm
parents: 2299
diff changeset
     2
# $Id$
9789
wenzelm
parents: 9680
diff changeset
     3
# Author: Markus Wenzel, TU Muenchen
wenzelm
parents: 9680
diff changeset
     4
# License: GPL (GNU GENERAL PUBLIC LICENSE)
2299
ed9720047d53 getsettings: bash source script to augment current env.
wenzelm
parents:
diff changeset
     5
#
2348
b51e104ecf40 *** empty log message ***
wenzelm
parents: 2307
diff changeset
     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
wenzelm
parents: 3118
diff changeset
    12
set -o allexport
wenzelm
parents: 3118
diff changeset
    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
476adc742599 added ISABELLE_HOME normalization;
wenzelm
parents: 2643
diff changeset
    16
#normalize ISABELLE_HOME as passed by caller
9789
wenzelm
parents: 9680
diff changeset
    17
ISABELLE_HOME=$(cd "$ISABELLE_HOME"; echo "$PWD")
2736
476adc742599 added ISABELLE_HOME normalization;
wenzelm
parents: 2643
diff changeset
    18
3185
wenzelm
parents: 3118
diff changeset
    19
#main executables
9789
wenzelm
parents: 9680
diff changeset
    20
ISABELLE="$ISABELLE_HOME/bin/isabelle"
wenzelm
parents: 9680
diff changeset
    21
ISATOOL="$ISABELLE_HOME/bin/isatool"
2299
ed9720047d53 getsettings: bash source script to augment current env.
wenzelm
parents:
diff changeset
    22
2643
a7f469c0ba59 tuned comments;
wenzelm
parents: 2621
diff changeset
    23
#users tend to put strange things in here ...
2621
e9e491033b54 globally unset ENV, BASH_ENV;
wenzelm
parents: 2590
diff changeset
    24
unset ENV
e9e491033b54 globally unset ENV, BASH_ENV;
wenzelm
parents: 2590
diff changeset
    25
unset BASH_ENV
e9e491033b54 globally unset ENV, BASH_ENV;
wenzelm
parents: 2590
diff changeset
    26
9680
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    27
#support easy settings
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    28
function choosefrom ()
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    29
{
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    30
  local RESULT=""
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    31
  local FILE=""
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    32
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    33
  for FILE in "$@"
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    34
  do
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    35
    [ -z "$RESULT" -a -e "$FILE" ] && RESULT="$FILE"
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    36
  done
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    37
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    38
  [ -z "$RESULT" ] && RESULT="$FILE"
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    39
  echo "$RESULT"
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    40
}
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    41
2643
a7f469c0ba59 tuned comments;
wenzelm
parents: 2621
diff changeset
    42
#get actual settings
9789
wenzelm
parents: 9680
diff changeset
    43
. "$ISABELLE_HOME/etc/settings" || exit 2
9227
298ae5f69b18 added ISABELLE_SITE_SETTINGS_PRESENT;
wenzelm
parents: 7770
diff changeset
    44
ISABELLE_SITE_SETTINGS_PRESENT=true
9789
wenzelm
parents: 9680
diff changeset
    45
wenzelm
parents: 9680
diff changeset
    46
[ "$ISABELLE_HOME" -ef "$ISABELLE_HOME_USER" ] && \
wenzelm
parents: 9680
diff changeset
    47
  { echo >&2 "### ISABELLE_HOME and ISABELLE_HOME_USER should not be the same directory!"; }
wenzelm
parents: 9680
diff changeset
    48
[ -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
    49
6413
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    50
#append ML system identifier to paths
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    51
if [ -z "$ML_PLATFORM" ]; then
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    52
  ML_IDENTIFIER="$ML_SYSTEM"
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    53
else
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    54
  ML_IDENTIFIER="${ML_SYSTEM}_${ML_PLATFORM}"
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    55
fi
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    56
ISABELLE_OUTPUT="$ISABELLE_OUTPUT/$ML_IDENTIFIER"
3118
24dae6222579 fixed ISABELLE_OUTPUT, ISABELLE_PATH (finally?);
wenzelm
parents: 2968
diff changeset
    57
2299
ed9720047d53 getsettings: bash source script to augment current env.
wenzelm
parents:
diff changeset
    58
set +o allexport
7770
0497323c1f0b ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents: 6413
diff changeset
    59
0497323c1f0b ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents: 6413
diff changeset
    60
fi