avoid global state change;
authorwenzelm
Thu Feb 25 18:05:04 2016 +0100 (2016-02-25)
changeset 62413c6111df4a4f8
parent 62412 ffdc5cf36dc5
child 62414 1abd90afe387
avoid global state change;
lib/scripts/getfunctions
lib/scripts/getsettings
     1.1 --- a/lib/scripts/getfunctions	Thu Feb 25 17:49:04 2016 +0100
     1.2 +++ b/lib/scripts/getfunctions	Thu Feb 25 18:05:04 2016 +0100
     1.3 @@ -15,17 +15,17 @@
     1.4    :
     1.5  else
     1.6  
     1.7 -set -o allexport
     1.8 -
     1.9  if [ "$OSTYPE" = cygwin ]; then
    1.10    function platform_path() { cygpath -i -C UTF8 -w -p "$@"; }
    1.11  else
    1.12    function platform_path() { echo "$@"; }
    1.13  fi
    1.14 +export -f platform_path
    1.15  
    1.16  #GNU tar (notably on Mac OS X)
    1.17  if [ -x /usr/bin/gnutar ]; then
    1.18    function tar() { /usr/bin/gnutar "$@"; }
    1.19 +  export -f tar
    1.20  fi
    1.21  
    1.22  #main executables
    1.23 @@ -33,14 +33,19 @@
    1.24  {
    1.25    "$ISABELLE_TOOL" "$@"
    1.26  }
    1.27 +export -f isabelle
    1.28 +
    1.29  function isabelle_process ()
    1.30  {
    1.31    "$ISABELLE_PROCESS" "$@"
    1.32  }
    1.33 +export -f isabelle_process
    1.34 +
    1.35  function isabelle_scala_script ()
    1.36  {
    1.37    "$ISABELLE_SCALA_SCRIPT" "$@"
    1.38  }
    1.39 +export -f isabelle_scala_script
    1.40  
    1.41  #shared library convenience
    1.42  function librarypath ()
    1.43 @@ -67,6 +72,7 @@
    1.44      esac
    1.45    done
    1.46  }
    1.47 +export -f librarypath
    1.48  
    1.49  #robust invocation via ISABELLE_JDK_HOME
    1.50  function isabelle_jdk ()
    1.51 @@ -79,6 +85,7 @@
    1.52      "$ISABELLE_JDK_HOME/bin/$PRG" "$@"
    1.53    fi
    1.54  }
    1.55 +export -f isabelle_jdk
    1.56  
    1.57  #robust invocation via JAVA_HOME
    1.58  function isabelle_java ()
    1.59 @@ -91,6 +98,7 @@
    1.60      "$JAVA_HOME/bin/$PRG" "$@"
    1.61    fi
    1.62  }
    1.63 +export -f isabelle_java
    1.64  
    1.65  #robust invocation via SCALA_HOME
    1.66  function isabelle_scala ()
    1.67 @@ -106,6 +114,7 @@
    1.68      "$SCALA_HOME/bin/$PRG" "$@"
    1.69    fi
    1.70  }
    1.71 +export -f isabelle_scala
    1.72  
    1.73  #classpath
    1.74  function classpath ()
    1.75 @@ -120,6 +129,7 @@
    1.76    done
    1.77    export ISABELLE_CLASSPATH
    1.78  }
    1.79 +export -f classpath
    1.80  
    1.81  #administrative build
    1.82  if [ -e "$ISABELLE_HOME/Admin/build" ]; then
    1.83 @@ -130,6 +140,7 @@
    1.84  else
    1.85    function isabelle_admin_build () { return 0; }
    1.86  fi
    1.87 +export -f isabelle_admin_build
    1.88  
    1.89  #arrays
    1.90  function splitarray ()
    1.91 @@ -141,6 +152,7 @@
    1.92      SPLITARRAY["${#SPLITARRAY[@]}"]="$X"
    1.93    done
    1.94  }
    1.95 +export -f splitarray
    1.96  
    1.97  #init component tree
    1.98  function init_component ()
    1.99 @@ -181,6 +193,7 @@
   1.100      init_components "$COMPONENT" "$COMPONENT/etc/components"
   1.101    fi
   1.102  }
   1.103 +export -f init_component
   1.104  
   1.105  #init component forest
   1.106  function init_components ()
   1.107 @@ -211,7 +224,6 @@
   1.108      init_component "$COMPONENT"
   1.109    done
   1.110  }
   1.111 -
   1.112 -set +o allexport
   1.113 +export -f init_components
   1.114  
   1.115  fi
     2.1 --- a/lib/scripts/getsettings	Thu Feb 25 17:49:04 2016 +0100
     2.2 +++ b/lib/scripts/getsettings	Thu Feb 25 18:05:04 2016 +0100
     2.3 @@ -7,12 +7,11 @@
     2.4  if [ -z "$ISABELLE_SETTINGS_PRESENT" ]
     2.5  then
     2.6  
     2.7 -set -o allexport
     2.8 +export ISABELLE_SETTINGS_PRESENT=true
     2.9  
    2.10 -ISABELLE_SETTINGS_PRESENT=true
    2.11 +export BASH_ENV="$ISABELLE_HOME/lib/scripts/getfunctions"
    2.12 +source "$BASH_ENV"
    2.13  
    2.14 -BASH_ENV="$ISABELLE_HOME/lib/scripts/getfunctions"
    2.15 -source "$BASH_ENV"
    2.16  set -o allexport
    2.17  
    2.18  #sane environment defaults (notably on Mac OS X)