From 3202ef296cd0118163d0b8c846210b34cf7d24f9 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@Germany>
Date: Tue, 3 May 2011 15:06:48 +0200
Subject: [PATCH] CONF: consolidate more files into OpenFOAM etc/config

---
 .gitignore                                    |  2 +
 etc/bashrc                                    |  4 +-
 etc/config/README                             | 51 +++++++++++++++++++
 etc/{ => config}/aliases.csh                  |  4 +-
 etc/{ => config}/aliases.sh                   |  4 +-
 etc/config/ensight.csh                        |  2 +-
 etc/config/ensight.sh                         |  2 +-
 .../example/prefs.csh}                        |  2 +-
 .../example/prefs.sh}                         |  2 +-
 etc/{ => config}/unset.csh                    |  2 +-
 etc/{ => config}/unset.sh                     |  2 +-
 etc/cshrc                                     |  4 +-
 12 files changed, 67 insertions(+), 14 deletions(-)
 create mode 100644 etc/config/README
 rename etc/{ => config}/aliases.csh (96%)
 rename etc/{ => config}/aliases.sh (97%)
 rename etc/{prefs.csh-EXAMPLE => config/example/prefs.csh} (98%)
 rename etc/{prefs.sh-EXAMPLE => config/example/prefs.sh} (98%)
 rename etc/{ => config}/unset.csh (99%)
 rename etc/{ => config}/unset.sh (99%)

diff --git a/.gitignore b/.gitignore
index 1b8ce3cde3c..67ac189fcca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,6 +60,8 @@ doc/[Dd]oxygen/man
 # untracked configuration files
 /etc/prefs.csh
 /etc/prefs.sh
+/etc/config/prefs.csh
+/etc/config/prefs.sh
 
 # source packages - anywhere
 *.tar.bz2
diff --git a/etc/bashrc b/etc/bashrc
index 3aaff82598f..62c9854d951 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -177,7 +177,7 @@ _foamEval()
 _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
 
 # Evaluate command-line parameters and record settings for later
-# these can be used to set/unset values, or specify prefs files
+# these can be used to set/unset values, or specify alternative pref files
 export FOAM_SETTINGS="$@"
 _foamEval $@
 
@@ -201,7 +201,7 @@ export PATH LD_LIBRARY_PATH MANPATH
 # Source project setup files
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~
 _foamSource $WM_PROJECT_DIR/etc/settings.sh
-_foamSource $WM_PROJECT_DIR/etc/aliases.sh
+_foamSource $WM_PROJECT_DIR/etc/config/aliases.sh
 
 
 # Source user setup files for optional packages
diff --git a/etc/config/README b/etc/config/README
new file mode 100644
index 00000000000..8c22b460161
--- /dev/null
+++ b/etc/config/README
@@ -0,0 +1,51 @@
+The main OpenFOAM settings are located in the parent etc/ directory
+
+* bashrc, cshrc
+  entry point for sourcing
+
+* settings.csh, settings.sh
+  core settings
+
+* prefs.csh, prefs.sh
+  these files are untracked and can be used for some site-defined
+  settings
+
+
+The etc/config/ directory contains various configuration files in
+sh/csh variants:
+
+* aliases.csh, aliases.sh
+  aliases for interactive shells
+
+* unset.csh, unset.sh
+  sourced to clear as many OpenFOAM environment settings as possible
+
+
+* ensight.csh, ensight.sh
+  application settings for EnSight
+
+* paraview.csh, paraview.sh
+  application settings for ParaView
+
+* scotch.sh
+  application settings for compiling against scotch
+
+---
+
+The config/example directory contains various example configuration files
+in sh/csh variants
+
+* compiler.csh, compiler.sh
+  an example of fine tuning ThirdParty compiler settings for OpenFOAM
+
+* openmpi.csh, openmpi.sh
+  an example of fine tuning openmpi settings for OpenFOAM
+
+* paraview.csh, paraview.sh
+  an example of chaining to the standard config/paraview.sh with a
+  different ParaView_VERSION
+
+* prefs.csh, prefs.sh
+  an example of supplying alternative site-defined settings
+
+---
diff --git a/etc/aliases.csh b/etc/config/aliases.csh
similarity index 96%
rename from etc/aliases.csh
rename to etc/config/aliases.csh
index 5c5b344497a..6573c91973a 100644
--- a/etc/aliases.csh
+++ b/etc/config/aliases.csh
@@ -22,7 +22,7 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # File
-#     etc/aliases.csh
+#     etc/config/aliases.csh
 #
 # Description
 #     Aliases for working with OpenFOAM
@@ -39,7 +39,7 @@ alias wmSP 'wmSET WM_PRECISION_OPTION=SP'
 alias wmDP 'wmSET WM_PRECISION_OPTION=DP'
 
 # clear env
-alias wmUNSET='source $WM_PROJECT_DIR/etc/unset.csh'
+alias wmUNSET='source $WM_PROJECT_DIR/etc/config/unset.csh'
 
 # Toggle wmakeScheduler on/off
 #  - also need to set WM_HOSTS
diff --git a/etc/aliases.sh b/etc/config/aliases.sh
similarity index 97%
rename from etc/aliases.sh
rename to etc/config/aliases.sh
index df0fda73898..188159745c1 100644
--- a/etc/aliases.sh
+++ b/etc/config/aliases.sh
@@ -22,7 +22,7 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # File
-#     etc/aliases.sh
+#     etc/config/aliases.sh
 #
 # Description
 #     Aliases for working with OpenFOAM
@@ -39,7 +39,7 @@ alias wmSP='wmSET WM_PRECISION_OPTION=SP'
 alias wmDP='wmSET WM_PRECISION_OPTION=DP'
 
 # clear env
-alias wmUNSET='. $WM_PROJECT_DIR/etc/unset.sh'
+alias wmUNSET='. $WM_PROJECT_DIR/etc/config/unset.sh'
 
 # Toggle wmakeScheduler on/off
 #  - also need to set WM_HOSTS
diff --git a/etc/config/ensight.csh b/etc/config/ensight.csh
index b1ce4ba112d..484fa0fc02d 100644
--- a/etc/config/ensight.csh
+++ b/etc/config/ensight.csh
@@ -2,7 +2,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #-------------------------------------------------------------------------------
 # License
diff --git a/etc/config/ensight.sh b/etc/config/ensight.sh
index 16ac2bd8395..597c51c010a 100644
--- a/etc/config/ensight.sh
+++ b/etc/config/ensight.sh
@@ -2,7 +2,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 2004-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 # License
diff --git a/etc/prefs.csh-EXAMPLE b/etc/config/example/prefs.csh
similarity index 98%
rename from etc/prefs.csh-EXAMPLE
rename to etc/config/example/prefs.csh
index 56091f798ed..83f7a7b7b45 100644
--- a/etc/prefs.csh-EXAMPLE
+++ b/etc/config/example/prefs.csh
@@ -22,7 +22,7 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # File
-#     etc/prefs.csh
+#     config/example/prefs.csh
 #
 # Description
 #     Preset variables for the OpenFOAM configuration - C-Shell shell syntax.
diff --git a/etc/prefs.sh-EXAMPLE b/etc/config/example/prefs.sh
similarity index 98%
rename from etc/prefs.sh-EXAMPLE
rename to etc/config/example/prefs.sh
index f3e771d030d..d2251ce63f1 100644
--- a/etc/prefs.sh-EXAMPLE
+++ b/etc/config/example/prefs.sh
@@ -22,7 +22,7 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # File
-#     etc/prefs.sh
+#     config/example/prefs.sh
 #
 # Description
 #     Preset variables for the OpenFOAM configuration - POSIX shell syntax.
diff --git a/etc/unset.csh b/etc/config/unset.csh
similarity index 99%
rename from etc/unset.csh
rename to etc/config/unset.csh
index 48a16379126..d9a3d697874 100644
--- a/etc/unset.csh
+++ b/etc/config/unset.csh
@@ -22,7 +22,7 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # File
-#     etc/unset.csh
+#     etc/config/unset.csh
 #
 # Description
 #     Clear as many OpenFOAM environment settings as possible
diff --git a/etc/unset.sh b/etc/config/unset.sh
similarity index 99%
rename from etc/unset.sh
rename to etc/config/unset.sh
index 23e182aa53f..66ee2e35b5b 100644
--- a/etc/unset.sh
+++ b/etc/config/unset.sh
@@ -22,7 +22,7 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # File
-#     etc/unset.sh
+#     etc/config/unset.sh
 #
 # Description
 #     Clear as many OpenFOAM environment settings as possible
diff --git a/etc/cshrc b/etc/cshrc
index 330fd66aa97..c87986832ab 100644
--- a/etc/cshrc
+++ b/etc/cshrc
@@ -138,7 +138,7 @@ alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!*
 _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
 
 # Evaluate command-line parameters and record settings for later
-# these can be used to set/unset values, or specify prefs files
+# these can be used to set/unset values, or specify alternative pref files
 setenv FOAM_SETTINGS "${*}"
 while ( $#argv > 0 )
     switch ($argv[1])
@@ -195,7 +195,7 @@ if ( $status == 0 ) setenv MANPATH $cleaned
 # Source project setup files
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~
 _foamSource $WM_PROJECT_DIR/etc/settings.csh
-_foamSource $WM_PROJECT_DIR/etc/aliases.csh
+_foamSource $WM_PROJECT_DIR/etc/config/aliases.csh
 
 # Source user setup files for optional packages
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- 
GitLab