From cfcea134502a3d9f3a3d923d7398c8b419ee813a Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@Germany>
Date: Fri, 19 Mar 2010 11:40:05 +0100
Subject: [PATCH] BUG: missed cleanup of env variables in etc/settings

---
 etc/bashrc            |  2 +-
 etc/cshrc             |  2 +-
 etc/prefs.csh-EXAMPLE |  2 +-
 etc/prefs.sh-EXAMPLE  |  3 ++-
 etc/settings.csh      | 14 ++++++--------
 etc/settings.sh       |  4 ++--
 6 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/etc/bashrc b/etc/bashrc
index d15c5324d56..c3e7c82bb35 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -272,4 +272,4 @@ fi
 unset cleaned foamClean foamInstall foamOldDirs
 unset _foamSource
 
-# -----------------------------------------------------------------------------
+# ----------------------------------------------------------------- end-of-file
diff --git a/etc/cshrc b/etc/cshrc
index 7b959e8c432..bc7a5868824 100644
--- a/etc/cshrc
+++ b/etc/cshrc
@@ -265,4 +265,4 @@ endif
 unset cleaned foamClean foamInstall foamOldDirs
 unalias _foamSource
 
-# -----------------------------------------------------------------------------
+# ----------------------------------------------------------------- end-of-file
diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE
index 775747ea660..5484ee451ba 100644
--- a/etc/prefs.csh-EXAMPLE
+++ b/etc/prefs.csh-EXAMPLE
@@ -50,4 +50,4 @@
 setenv ParaView_VERSION git        # eg, cvs/git version
 setenv ParaView_MAJOR 3.7
 
-# -----------------------------------------------------------------------------
+# ----------------------------------------------------------------- end-of-file
diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE
index 5878e82dbc0..0a0b25daae9 100644
--- a/etc/prefs.sh-EXAMPLE
+++ b/etc/prefs.sh-EXAMPLE
@@ -49,4 +49,5 @@ export WM_MPLIB=SYSTEMOPENMPI
 # ~~~~~~~~~~~~~~~~~~~~~~~~
 export ParaView_VERSION=git        # eg, cvs/git version
 export ParaView_MAJOR=3.7
-# -----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/etc/settings.csh b/etc/settings.csh
index 7a0d1f40c8e..7364fc8a50f 100644
--- a/etc/settings.csh
+++ b/etc/settings.csh
@@ -117,8 +117,8 @@ case OpenFOAM:
     endif
 
     _foamAddPath    ${WM_COMPILER_DIR}/bin
-    _foamAddLib     ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}
     _foamAddLib     ${WM_COMPILER_DIR}/lib
+    _foamAddLib     ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}
     _foamAddMan     ${WM_COMPILER_DIR}/man
 
     breaksw
@@ -128,7 +128,7 @@ endsw
 # Communications library
 # ~~~~~~~~~~~~~~~~~~~~~~
 
-unset MPI_ARCH_PATH
+unsetenv MPI_ARCH_PATH
 
 switch ("$WM_MPLIB")
 case OPENMPI:
@@ -256,7 +256,7 @@ _foamAddLib $FOAM_MPI_LIBBIN
 
 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-set minBufferSize=20000000
+if ( ! $?minBufferSize ) set minBufferSize=20000000
 
 if ( $?MPI_BUFFER_SIZE ) then
     if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
@@ -283,9 +283,7 @@ endif
 
 # cleanup environment:
 # ~~~~~~~~~~~~~~~~~~~~
-unalias _foamAddPath
-unalias _foamAddLib
-unalias _foamAddMan
-unset minBufferSize
+unalias _foamAddPath _foamAddLib _foamAddMan
+unset compilerInstall minBufferSize
 
-# -----------------------------------------------------------------------------
+# ----------------------------------------------------------------- end-of-file
diff --git a/etc/settings.sh b/etc/settings.sh
index ca3ab25c2c2..247b3a54ff0 100644
--- a/etc/settings.sh
+++ b/etc/settings.sh
@@ -295,7 +295,7 @@ _foamAddLib $FOAM_MPI_LIBBIN
 
 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-minBufferSize=20000000
+: ${minBufferSize:=20000000}
 
 if [ "${MPI_BUFFER_SIZE:=$minBufferSize}" -lt $minBufferSize ]
 then
@@ -321,4 +321,4 @@ export MPI_BUFFER_SIZE
 # ~~~~~~~~~~~~~~~~~~~~
 unset _foamAddPath _foamAddLib _foamAddMan minBufferSize
 
-# -----------------------------------------------------------------------------
+# ----------------------------------------------------------------- end-of-file
-- 
GitLab