Commit a51029a8 authored by Mark Olesen's avatar Mark Olesen
Browse files

CONFIG: use project api instead of version when finding config files

parent b21c7696
......@@ -29,6 +29,7 @@
# Driver script to run mpi jobs with the processes in a separate XTerm
# or to separate log files.
# Requires bash on all processors.
#
#------------------------------------------------------------------------------
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Run functions
......@@ -193,15 +194,17 @@ fi
sourceFoam=false # Fallback command
# check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/
# Same as foamEtcFile -mode=uo bashrc
#
# check ~/.$WM_PROJECT/$WM_PROJECT_API/
# check ~/.$WM_PROJECT/
# check <installedProject>/etc/
if [ -n "$WM_PROJECT" ]
then
for i in \
$HOME/.$WM_PROJECT/$WM_PROJECT_VERSION \
$HOME/.$WM_PROJECT \
$WM_PROJECT_DIR/etc \
"$HOME/.$WM_PROJECT/$WM_PROJECT_API" \
"$HOME/.$WM_PROJECT" \
"$WM_PROJECT_DIR/etc" \
;
do
if [ -f "$i/bashrc" ]
......
......@@ -16,6 +16,9 @@
# Description
# Quickly test the tutorials and write out the scheme/solver information
#
# Environment
# The entire OpenFOAM environment (WM_PROJECT_DIR, etc)
#
#------------------------------------------------------------------------------
cd ${0%/*} || exit 1 # Run from this directory
......@@ -128,24 +131,18 @@ EOF
#
# Location of the main controlDict
# Location of the user or project controlDict
#
unset MAIN_CONTROL_DICT
for i in \
$HOME/.$WM_PROJECT/$WM_PROJECT_VERSION \
$HOME/.$WM_PROJECT \
$WM_PROJECT_DIR/etc \
;
do
if [ -f "$i/controlDict" ]
if MAIN_CONTROL_DICT="$($WM_PROJECT_DIR/bin/foamEtcFile -mode=uo controlDict)"
then
if [ -e "${MAIN_CONTROL_DICT}.orig" ]
then
MAIN_CONTROL_DICT="$i/controlDict"
break
die "File ${MAIN_CONTROL_DICT}.orig already exists" \
"Did Alltest fail in some way and then run again?"
fi
done
[ -f "$MAIN_CONTROL_DICT" ] || usage "Main controlDict not found"
else
die "No main (user or project) controlDict found"
fi
TUTORIALS_DIR=$ROOT
......@@ -182,13 +179,6 @@ then
rm -rf $buildDir
fi
if [ -e ${MAIN_CONTROL_DICT}.orig ]
then
die "File ${MAIN_CONTROL_DICT}.orig already exists" \
"Did Alltest fail in some way and then run again?"
fi
unset gitbase
if [ -n "$useGit" ]
......
......@@ -43,8 +43,10 @@
#
# Sources the relevant cshrc/bashrc if not set.
#
# WM_PROJECT_DIR, WM_PROJECT and WM_PROJECT_VERSION will have been set
# before calling this routine.
# Environment
# - WM_PROJECT_DIR
# - WM_PROJECT
# - WM_PROJECT_API
#
#-------------------------------------------------------------------------------
Script=${0##*/}
......@@ -52,7 +54,7 @@ Script=${0##*/}
# csh sets HOST, bash sets HOSTNAME
: ${HOST:=$HOSTNAME}
lockDir=$HOME/.$WM_PROJECT/.wmake
lockDir="$HOME/.$WM_PROJECT/.wmake"
# Fallback - 1 core on current host
: ${WM_HOSTS:=$HOST:1}
......@@ -86,15 +88,17 @@ case $SHELL in
;;
esac
# Check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/
# Same as foamEtcFile -mode=uo bashrc
#
# Check ~/.$WM_PROJECT/$WM_PROJECT_API/
# Check ~/.$WM_PROJECT/
# Check <installedProject>/etc/
# Check projectDir/etc/
if [ -n "$WM_PROJECT" ]
then
for i in \
$HOME/.$WM_PROJECT/$WM_PROJECT_VERSION \
$HOME/.$WM_PROJECT \
$WM_PROJECT_DIR/etc \
"$HOME/.$WM_PROJECT/$WM_PROJECT_API" \
"$HOME/.$WM_PROJECT" \
"$WM_PROJECT_DIR/etc" \
;
do
if [ -f "$i/$shellRc" ]
......@@ -144,7 +148,6 @@ set -o pipefail
#------------------------------------------------------------------------------
colourPipe()
{
if tty -s <&1 # [ "$1" ]
then
(
......
......@@ -43,8 +43,10 @@
#
# Sources the relevant cshrc/bashrc if not set.
#
# WM_PROJECT_DIR, WM_PROJECT and WM_PROJECT_VERSION will have been set
# before calling this routine.
# Environment
# - WM_PROJECT_DIR
# - WM_PROJECT
# - WM_PROJECT_API
#
#-------------------------------------------------------------------------------
Script=${0##*/}
......@@ -52,7 +54,8 @@ Script=${0##*/}
# csh sets HOST, bash sets HOSTNAME
: ${HOST:=$HOSTNAME}
lockDir=$HOME/.$WM_PROJECT/.wmake
lockDir="$HOME/.$WM_PROJECT/.wmake"
# Fallback - 1 core on current host
: ${WM_HOSTS:=$HOST:1}
......@@ -85,15 +88,17 @@ case $SHELL in
;;
esac
# Check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/
# Same as foamEtcFile -mode=uo bashrc
#
# Check ~/.$WM_PROJECT/$WM_PROJECT_API/
# Check ~/.$WM_PROJECT/
# Check <installedProject>/etc/
# Check projectDir/etc/
if [ -n "$WM_PROJECT" ]
then
for i in \
$HOME/.$WM_PROJECT/$WM_PROJECT_VERSION \
$HOME/.$WM_PROJECT \
$WM_PROJECT_DIR/etc \
"$HOME/.$WM_PROJECT/$WM_PROJECT_API" \
"$HOME/.$WM_PROJECT" \
"$WM_PROJECT_DIR/etc" \
;
do
if [ -f "$i/$shellRc" ]
......@@ -138,9 +143,9 @@ done
set -o pipefail
#
#------------------------------------------------------------------------------
# Colour output by argument 1
#
#------------------------------------------------------------------------------
colourPipe()
{
if [ -n "$1" ]
......@@ -166,8 +171,7 @@ while [ "$#" -gt 0 ]
do
case "$1" in
-np)
shift
nprocs=$1
nprocs="$2"
shift
;;
-*)
......@@ -177,6 +181,7 @@ do
break
;;
esac
shift
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment