From 703dda294393498c6aa9283de3473fe0d31324c6 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 5 Mar 2010 15:00:39 +0100 Subject: [PATCH] STYLE: use new -space option from foamCleanPath --- etc/apps/paraview3/bashrc | 10 +++++----- etc/apps/paraview3/cshrc | 17 +++++++---------- etc/bashrc | 1 - etc/cshrc | 15 ++++----------- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc index ec6608e56b..c623244a59 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/apps/paraview3/bashrc @@ -27,13 +27,14 @@ # # Description # Setup file for paraview-3.x -# Sourced from OpenFOAM-*/etc/bashrc +# Sourced from OpenFOAM-*/etc/bashrc or from foamPV alias # # Note -# The env. variable 'ParaView_DIR' is required for building plugins +# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR' +# are required for building plugins #------------------------------------------------------------------------------ -#- Clean PATH +# clean the PATH cleanedEnv=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$WM_THIRD_PARTY_DIR/cmake- $WM_THIRD_PARTY_DIR/paraview-"` && PATH="$cleanedEnv" # determine the cmake to be used @@ -61,8 +62,7 @@ case "$ParaView_VERSION" in ;; *) - ParaView_MAJOR=$(echo $ParaView_VERSION | \ - sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/') + ParaView_MAJOR=`echo $ParaView_VERSION | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'` ;; esac export ParaView_MAJOR diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index 547869c584..befb2e972d 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -27,19 +27,16 @@ # # Description # Setup file for paraview-3.x -# Sourced from OpenFOAM-*/etc/cshrc +# Sourced from OpenFOAM-*/etc/cshrc or from foamPV alias # # Note -# The env. variable 'ParaView_DIR' is required for building plugins +# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR' +# are required for building plugins #------------------------------------------------------------------------------ -#- Clean PATH -set colonPath=`echo "$path" | sed -e 's/ /:/g'` -set cleanedEnv=`$WM_PROJECT_DIR/bin/foamCleanPath "$colonPath" "$WM_THIRD_PARTY_DIR/cmake- $WM_THIRD_PARTY_DIR/paraview-"` -if ( $status == 0 ) then - set path=`echo "$cleanedEnv" | sed -e 's/:/ /g'` -endif - +# clean the PATH +set cleanedEnv=`$WM_PROJECT_DIR/bin/foamCleanPath -space "$path" "$WM_THIRD_PARTY_DIR/cmake- $WM_THIRD_PARTY_DIR/paraview-"` +if ( $status == 0 ) set path=($cleanedEnv) # determine the cmake to be used unsetenv CMAKE_HOME @@ -91,5 +88,5 @@ else endif -unset cleanedEnv colonPath cmake paraviewInstDir paraviewPython +unset cleanedEnv cmake paraviewInstDir paraviewPython # ----------------------------------------------------------------------------- diff --git a/etc/bashrc b/etc/bashrc index e48b1f6ca1..26ad745540 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -237,7 +237,6 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.sh # Source user setup files for optional packages # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# _foamSource $WM_PROJECT_DIR/etc/apps/paraview/bashrc _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/bashrc _foamSource $WM_PROJECT_DIR/etc/apps/ensight/bashrc diff --git a/etc/cshrc b/etc/cshrc index fa20261f7a..0e6b3872f2 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -211,11 +211,8 @@ if (! $?MANPATH) then endif #- Clean path/PATH -set colonPath=`echo "$path" | sed -e 's/ /:/g'` -set cleanedEnv=`$cleanProg "$colonPath" "$foamOldDirs"` -if ( $status == 0 ) then - set path=`echo "$cleanedEnv" | sed -e 's/:/ /g'` -endif +set cleanedEnv=`$cleanProg -space "$path" "$foamOldDirs"` +if ( $status == 0 ) set path=($cleanedEnv) #- Clean LD_LIBRARY_PATH setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH" "$foamOldDirs"` @@ -233,7 +230,6 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.csh # Source user setup files for optional packages # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# _foamSource $WM_PROJECT_DIR/etc/apps/paraview/cshrc _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/cshrc # _foamSource $WM_PROJECT_DIR/etc/apps/ensight/cshrc @@ -241,11 +237,8 @@ _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/cshrc # Clean environment paths again. Only remove duplicates # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #- Clean path/PATH -set colonPath=`echo "$path" | sed -e 's/ /:/g'` -set cleanedEnv=`$cleanProg "$colonPath"` -if ( $status == 0 ) then - set path=`echo "$cleanedEnv" | sed -e 's/:/ /g'` -endif +set cleanedEnv=`$cleanProg -space "$colonPath"` +if ( $status == 0 ) set path=($cleanedEnv) #- Clean LD_LIBRARY_PATH setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH"`