From c1ca2f4a381384db3b4b15343ea93093cda27638 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@Germany> Date: Thu, 23 Feb 2017 01:07:10 +0100 Subject: [PATCH] BUG: missing chdir in Allwclean for wallFunctionTable STYLE: improve consistency in Allwclean scripts --- .../solvers/lagrangian/DPMFoam/Allwclean | 5 ++- .../solvers/lagrangian/DPMFoam/Allwmake | 2 + .../multiphase/MPPICInterFoam/Allwclean | 2 +- .../miscellaneous/foamHelp/Allwclean | 1 - .../graphics/PVReaders/Allwclean | 3 -- .../graphics/PVReaders/Allwmake | 4 -- .../preProcessing/wallFunctionTable/Allwclean | 2 + src/Pstream/Allwclean | 23 +++++------ src/parallel/decompose/Allwclean | 38 +++++-------------- src/regionModels/Allwclean | 11 +++--- wmake/wclean | 15 ++++---- 11 files changed, 40 insertions(+), 66 deletions(-) diff --git a/applications/solvers/lagrangian/DPMFoam/Allwclean b/applications/solvers/lagrangian/DPMFoam/Allwclean index 158a56c8f34..f953f598740 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwclean +++ b/applications/solvers/lagrangian/DPMFoam/Allwclean @@ -1,7 +1,8 @@ #!/bin/sh - -cd ${0%/*} || exit 1 +cd ${0%/*} || exit 1 # Run from this directory wclean libso DPMTurbulenceModels wclean wclean MPPICFoam + +#------------------------------------------------------------------------------ diff --git a/applications/solvers/lagrangian/DPMFoam/Allwmake b/applications/solvers/lagrangian/DPMFoam/Allwmake index 1f021bfc2fd..2af858f6bb9 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwmake +++ b/applications/solvers/lagrangian/DPMFoam/Allwmake @@ -8,3 +8,5 @@ wmake $targetType DPMTurbulenceModels wmake $targetType wmake $targetType MPPICFoam + +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/MPPICInterFoam/Allwclean b/applications/solvers/multiphase/MPPICInterFoam/Allwclean index 12d384e3569..79ee0feb220 100755 --- a/applications/solvers/multiphase/MPPICInterFoam/Allwclean +++ b/applications/solvers/multiphase/MPPICInterFoam/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory wclean libso CompressibleTwoPhaseMixtureTurbulenceModels wclean diff --git a/applications/utilities/miscellaneous/foamHelp/Allwclean b/applications/utilities/miscellaneous/foamHelp/Allwclean index 68cf4d81518..b34d18b24a2 100755 --- a/applications/utilities/miscellaneous/foamHelp/Allwclean +++ b/applications/utilities/miscellaneous/foamHelp/Allwclean @@ -4,5 +4,4 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso helpTypes wclean - #------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean index 6614154374a..54808b94b1b 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean +++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean @@ -5,7 +5,4 @@ wclean libso foamPv PVblockMeshReader/Allwclean PVFoamReader/Allwclean -# remove dummy directory (see Allwmake) -rmdir Make 2>/dev/null - #------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake index 13eb3a94706..d80b89f34dc 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake +++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake @@ -24,10 +24,6 @@ case "$major" in wmakeLibPv foamPv PVblockMeshReader/Allwmake $targetType $* PVFoamReader/Allwmake $targetType $* - - # Dummy directory to trigger proper 'wclean all' behaviour - # - the Allwclean will otherwise not be used - mkdir -p Make ) fi ;; diff --git a/applications/utilities/preProcessing/wallFunctionTable/Allwclean b/applications/utilities/preProcessing/wallFunctionTable/Allwclean index bf93e1c06b7..d2a7ff3af90 100755 --- a/applications/utilities/preProcessing/wallFunctionTable/Allwclean +++ b/applications/utilities/preProcessing/wallFunctionTable/Allwclean @@ -1,5 +1,7 @@ #!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory wclean libso tabulatedWallFunction wclean +#------------------------------------------------------------------------------ diff --git a/src/Pstream/Allwclean b/src/Pstream/Allwclean index 2650e4e38a9..29ce00baa0c 100755 --- a/src/Pstream/Allwclean +++ b/src/Pstream/Allwclean @@ -1,26 +1,23 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -# Define how an mpi-versioned library is created -# clean the qualified directory +# Clean an mpi-versioned library wcleanMpiLib() { - for libName - do + case "$WM_MPLIB" in (*MPI*) ( WM_OPTIONS="$WM_OPTIONS$WM_MPLIB" - wclean $libName + for libName + do + wclean $libName + done ) - done + ;; + esac } -wclean dummy - -case "$WM_MPLIB" in -*MPI*) - wcleanMpiLib mpi - ;; -esac +wclean dummy +wcleanMpiLib mpi #------------------------------------------------------------------------------ diff --git a/src/parallel/decompose/Allwclean b/src/parallel/decompose/Allwclean index ef6dc412124..88c606b523c 100755 --- a/src/parallel/decompose/Allwclean +++ b/src/parallel/decompose/Allwclean @@ -1,44 +1,26 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -# get SCOTCH_VERSION, SCOTCH_ARCH_PATH -if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch` -then - . $settings - echo " using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH" -else - echo - echo " Error: no config.sh/scotch settings" - echo -fi - - -# Define how to clean an mpi-versioned library +# Clean an mpi-versioned library wcleanMpiLib() { - for libName - do + case "$WM_MPLIB" in (*MPI*) ( WM_OPTIONS="$WM_OPTIONS$WM_MPLIB" - wclean $libName + for libName + do + wclean $libName + done ) - done + ;; + esac } -if [ -n "$SCOTCH_ARCH_PATH" ] -then - wclean scotchDecomp - - if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ] - then - wcleanMpiLib ptscotchDecomp - fi -else - echo " skipping scotchDecomp (ptscotchDecomp)" -fi +wclean scotchDecomp wclean metisDecomp wclean decompositionMethods wclean decompose +wcleanMpiLib ptscotchDecomp #------------------------------------------------------------------------------ diff --git a/src/regionModels/Allwclean b/src/regionModels/Allwclean index 2996d85d615..7ba2cd3e517 100755 --- a/src/regionModels/Allwclean +++ b/src/regionModels/Allwclean @@ -1,11 +1,10 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -makeType=${1:-libso} -wclean $makeType regionModel -wclean $makeType pyrolysisModels -wclean $makeType surfaceFilmModels -wclean $makeType thermalBaffleModels -wclean $makeType regionCoupling +wclean libso regionModel +wclean libso pyrolysisModels +wclean libso surfaceFilmModels +wclean libso thermalBaffleModels +wclean libso regionCoupling #------------------------------------------------------------------------------ diff --git a/wmake/wclean b/wmake/wclean index 0f3e5eb8de9..426dd18a8cc 100755 --- a/wmake/wclean +++ b/wmake/wclean @@ -128,8 +128,8 @@ then } fi - # Print command - echo "$Script $targetType${targetType:+ }${dir:-.}" + # Print command, trim off leading './' for readability + echo "$Script $targetType${targetType:+ }${dir#./}" fi @@ -152,19 +152,18 @@ then echo "Removing empty directories..." # Get sub-directories avoiding particular directories - for dir in $(find . -mindepth 1 -maxdepth 1 \ - -name .git -prune -o -type d -print) + for d in $(find . -mindepth 1 -maxdepth 1 \ + -name .git -prune -o -type d -print) do - echo " searching: $dir" - find $dir -depth -empty -type d -delete -print + echo " searching: ${d#./}" + find $d -depth -empty -type d -delete -print done # Second pass: clean up object directories with WM_PROJECT_DIR that don't # have respective source code folders, along with the respective binaries - if [ "$(expandPath $PWD)" = "$WM_PROJECT_DIR" ] then - objectsDir=$(findObjectDir $PWD) || exit 1 # Fatal + objectsDir=$(findObjectDir $PWD 2>/dev/null) || exit 1 # Fatal if [ -d "$objectsDir" ] then -- GitLab