avoid global state change;
authorwenzelm
Thu, 25 Feb 2016 18:05:04 +0100
changeset 62413 c6111df4a4f8
parent 62412 ffdc5cf36dc5
child 62414 1abd90afe387
avoid global state change;
lib/scripts/getfunctions
lib/scripts/getsettings
--- a/lib/scripts/getfunctions	Thu Feb 25 17:49:04 2016 +0100
+++ b/lib/scripts/getfunctions	Thu Feb 25 18:05:04 2016 +0100
@@ -15,17 +15,17 @@
   :
 else
 
-set -o allexport
-
 if [ "$OSTYPE" = cygwin ]; then
   function platform_path() { cygpath -i -C UTF8 -w -p "$@"; }
 else
   function platform_path() { echo "$@"; }
 fi
+export -f platform_path
 
 #GNU tar (notably on Mac OS X)
 if [ -x /usr/bin/gnutar ]; then
   function tar() { /usr/bin/gnutar "$@"; }
+  export -f tar
 fi
 
 #main executables
@@ -33,14 +33,19 @@
 {
   "$ISABELLE_TOOL" "$@"
 }
+export -f isabelle
+
 function isabelle_process ()
 {
   "$ISABELLE_PROCESS" "$@"
 }
+export -f isabelle_process
+
 function isabelle_scala_script ()
 {
   "$ISABELLE_SCALA_SCRIPT" "$@"
 }
+export -f isabelle_scala_script
 
 #shared library convenience
 function librarypath ()
@@ -67,6 +72,7 @@
     esac
   done
 }
+export -f librarypath
 
 #robust invocation via ISABELLE_JDK_HOME
 function isabelle_jdk ()
@@ -79,6 +85,7 @@
     "$ISABELLE_JDK_HOME/bin/$PRG" "$@"
   fi
 }
+export -f isabelle_jdk
 
 #robust invocation via JAVA_HOME
 function isabelle_java ()
@@ -91,6 +98,7 @@
     "$JAVA_HOME/bin/$PRG" "$@"
   fi
 }
+export -f isabelle_java
 
 #robust invocation via SCALA_HOME
 function isabelle_scala ()
@@ -106,6 +114,7 @@
     "$SCALA_HOME/bin/$PRG" "$@"
   fi
 }
+export -f isabelle_scala
 
 #classpath
 function classpath ()
@@ -120,6 +129,7 @@
   done
   export ISABELLE_CLASSPATH
 }
+export -f classpath
 
 #administrative build
 if [ -e "$ISABELLE_HOME/Admin/build" ]; then
@@ -130,6 +140,7 @@
 else
   function isabelle_admin_build () { return 0; }
 fi
+export -f isabelle_admin_build
 
 #arrays
 function splitarray ()
@@ -141,6 +152,7 @@
     SPLITARRAY["${#SPLITARRAY[@]}"]="$X"
   done
 }
+export -f splitarray
 
 #init component tree
 function init_component ()
@@ -181,6 +193,7 @@
     init_components "$COMPONENT" "$COMPONENT/etc/components"
   fi
 }
+export -f init_component
 
 #init component forest
 function init_components ()
@@ -211,7 +224,6 @@
     init_component "$COMPONENT"
   done
 }
-
-set +o allexport
+export -f init_components
 
 fi
--- a/lib/scripts/getsettings	Thu Feb 25 17:49:04 2016 +0100
+++ b/lib/scripts/getsettings	Thu Feb 25 18:05:04 2016 +0100
@@ -7,12 +7,11 @@
 if [ -z "$ISABELLE_SETTINGS_PRESENT" ]
 then
 
-set -o allexport
+export ISABELLE_SETTINGS_PRESENT=true
 
-ISABELLE_SETTINGS_PRESENT=true
+export BASH_ENV="$ISABELLE_HOME/lib/scripts/getfunctions"
+source "$BASH_ENV"
 
-BASH_ENV="$ISABELLE_HOME/lib/scripts/getfunctions"
-source "$BASH_ENV"
 set -o allexport
 
 #sane environment defaults (notably on Mac OS X)