lib/scripts/getsettings
author wenzelm
Thu, 24 Aug 2000 00:53:53 +0200
changeset 9680 6581bfc8421e
parent 9227 298ae5f69b18
child 9789 7e5e6c47c0b5
permissions -rw-r--r--
choosefrom: support easy settings;
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$
2299
ed9720047d53 getsettings: bash source script to augment current env.
wenzelm
parents:
diff changeset
     3
#
2348
b51e104ecf40 *** empty log message ***
wenzelm
parents: 2307
diff changeset
     4
# getsettings - bash source script to augment current env.
2299
ed9720047d53 getsettings: bash source script to augment current env.
wenzelm
parents:
diff changeset
     5
#
ed9720047d53 getsettings: bash source script to augment current env.
wenzelm
parents:
diff changeset
     6
7770
0497323c1f0b ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents: 6413
diff changeset
     7
if [ -z "$ISABELLE_SETTINGS_PRESENT" ]
0497323c1f0b ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents: 6413
diff changeset
     8
then
0497323c1f0b ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents: 6413
diff changeset
     9
3185
wenzelm
parents: 3118
diff changeset
    10
set -o allexport
wenzelm
parents: 3118
diff changeset
    11
7770
0497323c1f0b ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents: 6413
diff changeset
    12
ISABELLE_SETTINGS_PRESENT=true
0497323c1f0b ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents: 6413
diff changeset
    13
2736
476adc742599 added ISABELLE_HOME normalization;
wenzelm
parents: 2643
diff changeset
    14
#normalize ISABELLE_HOME as passed by caller
476adc742599 added ISABELLE_HOME normalization;
wenzelm
parents: 2643
diff changeset
    15
ISABELLE_HOME=$(cd $ISABELLE_HOME; echo $PWD)
476adc742599 added ISABELLE_HOME normalization;
wenzelm
parents: 2643
diff changeset
    16
3185
wenzelm
parents: 3118
diff changeset
    17
#main executables
wenzelm
parents: 3118
diff changeset
    18
ISABELLE=$ISABELLE_HOME/bin/isabelle
wenzelm
parents: 3118
diff changeset
    19
ISATOOL=$ISABELLE_HOME/bin/isatool
2299
ed9720047d53 getsettings: bash source script to augment current env.
wenzelm
parents:
diff changeset
    20
2643
a7f469c0ba59 tuned comments;
wenzelm
parents: 2621
diff changeset
    21
#users tend to put strange things in here ...
2621
e9e491033b54 globally unset ENV, BASH_ENV;
wenzelm
parents: 2590
diff changeset
    22
unset ENV
e9e491033b54 globally unset ENV, BASH_ENV;
wenzelm
parents: 2590
diff changeset
    23
unset BASH_ENV
e9e491033b54 globally unset ENV, BASH_ENV;
wenzelm
parents: 2590
diff changeset
    24
9680
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    25
#support easy settings
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    26
function choosefrom ()
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    27
{
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    28
  local RESULT=""
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    29
  local FILE=""
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    30
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    31
  for FILE in "$@"
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    32
  do
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    33
    [ -z "$RESULT" -a -e "$FILE" ] && RESULT="$FILE"
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    34
  done
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    35
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    36
  [ -z "$RESULT" ] && RESULT="$FILE"
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    37
  echo "$RESULT"
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    38
}
6581bfc8421e choosefrom: support easy settings;
wenzelm
parents: 9227
diff changeset
    39
2643
a7f469c0ba59 tuned comments;
wenzelm
parents: 2621
diff changeset
    40
#get actual settings
2428
853732a26bdd improved error handling;
wenzelm
parents: 2348
diff changeset
    41
. $ISABELLE_HOME/etc/settings || exit 2
9227
298ae5f69b18 added ISABELLE_SITE_SETTINGS_PRESENT;
wenzelm
parents: 7770
diff changeset
    42
ISABELLE_SITE_SETTINGS_PRESENT=true
2299
ed9720047d53 getsettings: bash source script to augment current env.
wenzelm
parents:
diff changeset
    43
[ -f $ISABELLE_HOME_USER/etc/settings ] && . $ISABELLE_HOME_USER/etc/settings
ed9720047d53 getsettings: bash source script to augment current env.
wenzelm
parents:
diff changeset
    44
6413
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    45
#append ML system identifier to paths
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    46
if [ -z "$ML_PLATFORM" ]; then
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    47
  ML_IDENTIFIER="$ML_SYSTEM"
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    48
else
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    49
  ML_IDENTIFIER="${ML_SYSTEM}_${ML_PLATFORM}"
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    50
fi
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    51
ISABELLE_OUTPUT="$ISABELLE_OUTPUT/$ML_IDENTIFIER"
b2f2770ef8d9 ML_PLATFORM;
wenzelm
parents: 3185
diff changeset
    52
ISABELLE_PATH=$(for DIR in $(echo $ISABELLE_PATH | tr : " "); do echo $DIR/$ML_IDENTIFIER; done)
3118
24dae6222579 fixed ISABELLE_OUTPUT, ISABELLE_PATH (finally?);
wenzelm
parents: 2968
diff changeset
    53
ISABELLE_PATH=$(echo $ISABELLE_PATH | tr " " :)
24dae6222579 fixed ISABELLE_OUTPUT, ISABELLE_PATH (finally?);
wenzelm
parents: 2968
diff changeset
    54
2299
ed9720047d53 getsettings: bash source script to augment current env.
wenzelm
parents:
diff changeset
    55
set +o allexport
7770
0497323c1f0b ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents: 6413
diff changeset
    56
0497323c1f0b ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents: 6413
diff changeset
    57
fi