diff --git a/bin/foamDiffSourceList b/bin/foamDiffSourceList deleted file mode 100755 index 560d965032..0000000000 --- a/bin/foamDiffSourceList +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. -# \\/ M anipulation | -#------------------------------------------------------------------------------- -# License -# This file is part of OpenFOAM. -# -# OpenFOAM is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenFOAM; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# Script -# foamDiffSourceList -# -# Description -# Packs and compresses files that have changed (diff -uw) between -# oldDir newDir -# -#------------------------------------------------------------------------------ -tmpFile=${TMPDIR:-/tmp}/foamDiffList.$$ - -if [ $# -ne 3 ]; then - echo "Usage : ${0##*/} oldDir newDir tarFile" - echo "" - echo "Find the files that changed (diff -uw) between and " - echo "and pack them into " - echo "" - exit 1 -fi - -# canonical form (no double and no trailing dashes) -oldDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@') -newDir=$(echo "$2" | sed -e 's@//*@/@g' -e 's@/$@@') -packFile=$3 - -if [ ! -d $oldDir ]; then - echo "Error: directory $oldDir does not exist" - exit 1 -fi - -if [ ! -d $newDir ]; then - echo "Error: directory $newDir does not exist" - exit 1 -fi - -if [ -f $packFile ]; then - echo "Error: $packFile already exists" - exit 1 -fi - -# Clean up on termination and on Ctrl-C -trap 'rm -f $tmpFile 2>/dev/null; exit 0' EXIT TERM INT - -fileCount=0 -cat /dev/null > $tmpFile - -find -H $newDir \ - ! -type d -type f \ - ! -name "*~" \ - -a ! -name ".*~" \ - -a ! -name ".#*" \ - -a ! -name "*.orig" \ - -a ! -name "*.dep" \ - -a ! -name "*.o" \ - -a ! -name "*.so" \ - -a ! -name "*.a" \ - -a ! -name "*.tgz" \ - -a ! -name "core" \ - -a ! -name "core.[1-9]*" \ - -a ! -name "log[0-9]*" \ -| sed \ - -e "\@$newDir/.git/@d" \ - -e "\@$newDir/lib/@d" \ - -e '\@applications/bin/@d' \ - -e '\@/t/@d' \ - -e '\@Make[.A-Za-z]*/[^/]*/@d' \ - -e '\@[Dd]oxygen/html@d' \ - -e '\@[Dd]oxygen/latex@d' \ - -e '\@[Dd]oxygen/man@d' \ - -e "s@$newDir/*@@" \ - | \ - ( - while read file - do - (( fileCount=$fileCount + 1)) - - if [ -f "$oldDir/$file" ] - then - diff -uw $oldDir/$file $newDir/$file >/dev/null 2>&1 - if [ $? = 1 ] - then - echo "[DIFF]" $file - echo $newDir/$file >> $tmpFile - continue - fi - else - echo "[NEW]" $file - echo $newDir/$file >> $tmpFile - continue - fi - echo $fileCount $file - done - ) - -# file fileCount -fileCount=$(cat $tmpFile | wc -l) -echo "----------------------------------------------------------------------" -echo "pack $fileCount changed/new files" - -tar -czpf $packFile --files-from $tmpFile - -if [ $? = 0 ] -then - echo "Finished packing changed files from $newDir into $packFile" -else - echo "Error: failure packing changed files from $newDir into $packFile" - rm -f $packFile 2>/dev/null -fi -echo "----------------------------------------------------------------------" - -# ---------------------------------------------------------------------------- diff --git a/bin/foamExec b/bin/foamExec index b4ec646637..dea3c664f8 100755 --- a/bin/foamExec +++ b/bin/foamExec @@ -37,13 +37,11 @@ # foamExec -v ... -parallel # #------------------------------------------------------------------------------ -Script=${0##*/} - usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< ... +usage: ${0##*/} [OPTION] ... options: -v ver specify OpenFOAM version diff --git a/bin/foamJob b/bin/foamJob index 39d32db801..1aad5fca99 100755 --- a/bin/foamJob +++ b/bin/foamJob @@ -29,13 +29,11 @@ # Description # #------------------------------------------------------------------------------ -Script=${0##*/} - usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< ... +usage: ${0##*/} [OPTION] ... options: -case dir specify case directory @@ -108,9 +106,9 @@ do usage ;; -case) - shift - caseDir=$1 - [ "$#" -ge 1 ] || usage "'-case' option requires an argument" + [ "$#" -ge 2 ] || usage "'-case' option requires an argument" + caseDir=$2 + shift 2 cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'" ;; -s) diff --git a/bin/foamNew b/bin/foamNew index 3900c3c74c..15005c5c83 100755 --- a/bin/foamNew +++ b/bin/foamNew @@ -30,13 +30,11 @@ # Create a new standard OpenFOAM source file # #------------------------------------------------------------------------------ -Script=${0##*/} - usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< {args} +usage: ${0##*/} {args} * create a new standard OpenFOAM source file diff --git a/bin/foamPack b/bin/foamPack index 6541e10c4a..8166714c6b 100755 --- a/bin/foamPack +++ b/bin/foamPack @@ -43,7 +43,8 @@ then fi # add optional output directory -if [ -d "$1" ]; then +if [ -d "$1" ] +then packFile="$1/$packFile" fi diff --git a/bin/foamPackBin b/bin/foamPackBin index 99ceabb402..4c0d673e27 100755 --- a/bin/foamPackBin +++ b/bin/foamPackBin @@ -31,7 +31,7 @@ # #------------------------------------------------------------------------------ -if [ $# = 0 ] +if [ $# -eq 0 ] then echo "Error: architecture type expected, exiting" echo diff --git a/bin/foamPackBinAll b/bin/foamPackBinAll index 76ad4ffb81..45708b17c3 100755 --- a/bin/foamPackBinAll +++ b/bin/foamPackBinAll @@ -27,7 +27,7 @@ # foamPackBinAll [outputDir] # # Description -# Packs and compresses all binary version of foam for release +# Packs and compresses all binary versions of foam for release # #------------------------------------------------------------------------------ packDir=$WM_PROJECT-$WM_PROJECT_VERSION @@ -38,6 +38,7 @@ then exit 1 fi +# obtain arch types from lib/ for bin in $packDir/lib/* do foamPackBin ${bin##*/} $@ diff --git a/bin/foamPackChanged b/bin/foamPackChanged deleted file mode 100755 index 93fac19060..0000000000 --- a/bin/foamPackChanged +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. -# \\/ M anipulation | -#------------------------------------------------------------------------------- -# License -# This file is part of OpenFOAM. -# -# OpenFOAM is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenFOAM; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# Script -# foamPackChanged -# -# Description -# Packs and compresses files that have a corresponding .orig file -# -#------------------------------------------------------------------------------ -tmpFile=${TMPDIR:-/tmp}/foamPackChanged.$$ - -if [ $# -ne 2 ]; then - echo "Usage : ${0##*/} directory tarFile" - echo "" - echo "Packs and compresses files that have a corresponding .orig file" - echo "" - exit 1 -fi - -# canonical form (no double and no trailing dashes) -packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@') -packFile=$2 - -if [ ! -d $packDir ]; then - echo "Error: directory $packDir does not exist" - exit 1 -fi - -# Clean up on termination and on Ctrl-C -trap 'rm -f $tmpFile 2>/dev/null; exit 0' EXIT TERM INT - -fileCount=0 -cat /dev/null > $tmpFile - -find -H $packDir \ - ! -type d \ - -type f \ - -name "*.orig" \ -| sed \ - -e "\@$packDir/lib/@d" \ - -e '\@applications/bin/@d' \ - -e '\@/t/@d' \ - -e '\@Make[.A-Za-z]*/[^/]*/@d' \ - -e '\@[Dd]oxygen/html@d' \ - -e '\@[Dd]oxygen/latex@d' \ - -e '\@[Dd]oxygen/man@d' \ - -e "s@$packDir/*@@" \ - | \ - ( - while read file - do - (( fileCount=$fileCount + 1 )) - - file=${file%%.orig} - - if [ -f "$packDir/$file" ] - then - echo $fileCount $file - echo $packDir/$file >> $tmpFile - else - echo "[MISSING]" $file - fi - done - ) - -# file fileCount -fileCount=$(cat $tmpFile | wc -l) -echo "----------------------------------------------------------------------" -echo "pack $fileCount updated (non-.orig) files" - -tar -czpf $packFile --files-from $tmpFile - -if [ $? = 0 ] -then - echo "Finished packing changed files from $packDir into $packFile" -else - echo "Error: failure packing changed files from $packDir into $packFile" - rm -f $packFile 2>/dev/null -fi -echo "----------------------------------------------------------------------" - -# ---------------------------------------------------------------------------- diff --git a/bin/foamPackDoxygen b/bin/foamPackDoxygen new file mode 100755 index 0000000000..239c87c740 --- /dev/null +++ b/bin/foamPackDoxygen @@ -0,0 +1,121 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------- +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# Script +# foamPackDoxygen [-prefix DIR] [-o outputDir] +# +# Description +# Packs and compresses the OpenFOAM doxygen html for release +# +#------------------------------------------------------------------------------ +packDir=$WM_PROJECT-$WM_PROJECT_VERSION +packTag=_Doxygen.gtgz + +usage() { +cat <&2 +Usage: ${0##*/} [-prefix DIR] [-o outputDir] + + Packs and compresses the OpenFOAM doxygen html for release + +USAGE + exit 1 +} + +unset prefix outputDir + +while [ "$#" -gt 0 ] +do + case $1 in + -prefix | --prefix ) + prefix=${2%%/} + shift 2 + ;; + -o | -output ) + outputDir=${2%%/} + shift 2 + ;; + -h | -help ) + usage + ;; + -*) + usage "unknown option: '$*'" + ;; + esac +done + +# if packing from within the directory, use -prefix form +if [ "${PWD##*/}" = "$packDir" ] +then + : ${prefix:=$packDir} +fi + +# pack the directories directly and add prefix afterwards +if [ -n "$prefix" ] +then + packDir="$prefix" +elif [ ! -d $packDir ] +then + echo "Error: directory $packDir does not exist" + exit 1 +fi + +# +# add optional output directory +# +if [ -d "$outputDir" ] +then + packFile="$outputDir/$packDir$packTag" +else + packFile="$packDir$packTag" +fi + + +if [ -f $packFile ] +then + echo "Error: $packFile already exists" + exit 1 +fi + +# Pack and compress the packFile using GNU tar +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +echo +echo "Packing doxygen html into $packFile" +echo + +if [ -n "$prefix" ] +then + tar czpf $packFile --transform="s@^@$prefix/@" doc/Doxygen/html +else + tar czpf $packFile $packDir/doc/Doxygen/html +fi + +if [ $? = 0 ] +then + echo "Finished packing doxygen html into file $packFile" +else + echo "Error: failure packing doxygen html file $packFile" +fi + +#------------------------------------------------------------------------------ diff --git a/bin/foamPackSource b/bin/foamPackSource index 7db55ed86b..2bdee4916d 100755 --- a/bin/foamPackSource +++ b/bin/foamPackSource @@ -33,7 +33,8 @@ #------------------------------------------------------------------------------ tmpFile=${TMPDIR:-/tmp}/foamPackFiles.$$ -if [ $# -ne 2 ]; then +if [ $# -ne 2 ] +then echo "Usage : ${0##*/} directory tarFile" echo "" echo "Packs all .C and .H files and Make/options and Make/files into" @@ -46,12 +47,14 @@ fi packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@') packFile=$2 -if [ ! -d $packDir ]; then +if [ ! -d $packDir ] +then echo "Error: directory $packDir does not exist" exit 1 fi -if [ -f $packFile ]; then +if [ -f $packFile ] +then echo "Error: $packFile already exists" exit 1 fi diff --git a/bin/foamPackThirdPartyBin b/bin/foamPackThirdPartyBin index 484c0c1e4b..cc99b95d27 100755 --- a/bin/foamPackThirdPartyBin +++ b/bin/foamPackThirdPartyBin @@ -33,14 +33,14 @@ if [ $# = 0 ] then - echo "Error: archOptionsitecture type expected, exiting" + echo "Error: archOptions type expected, exiting" echo echo "Usage : ${0##*/} [outputDir]" echo exit 1 fi archOptions=$1 -arch=${archOptions%%G*} +arch=${archOptions%%G*} # TODO: works for Gcc only arch3264=$(echo "$arch" | sed 's@64@-64@') timeStamp=$(date +%Y-%m-%d) diff --git a/bin/paraFoam b/bin/paraFoam index 93fb4cf03b..217596343a 100755 --- a/bin/paraFoam +++ b/bin/paraFoam @@ -30,13 +30,11 @@ # start paraview with the OpenFOAM libraries # #------------------------------------------------------------------------------ -Script=${0##*/} - usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat</dev/null || usage "directory does not exist: '$caseDir'" ;; *) usage "unknown option/argument: '$*'" ;; esac -fi +done # get a sensible caseName caseName=${PWD##*/} +caseFile="$caseName.OpenFOAM" # parent directory for normal or parallel results case "$caseName" in @@ -77,8 +77,6 @@ do [ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'" done -#caseFile="$caseName.foam" -caseFile="$caseName.OpenFOAM" case "$ParaView_VERSION" in 2*) diff --git a/bin/rmcore b/bin/rmcore index 6014adc414..1245878ff3 100755 --- a/bin/rmcore +++ b/bin/rmcore @@ -1,3 +1,3 @@ #!/bin/sh -#find . \( -name 'core' \) -exec ls -l {} \; -exec rm {} \; +# find . \( -name 'core' \) -exec ls -l {} \; -exec rm {} \; find . \( -type f -name 'core' -o -name 'core.[1-9]*' -o -name 'vgcore.*' \) -print | xargs -t rm diff --git a/bin/rmdepall b/bin/rmdepall index 89e6e4c566..84e6526741 100755 --- a/bin/rmdepall +++ b/bin/rmdepall @@ -1,12 +1,15 @@ #!/bin/sh -if [ $# -eq 0 ]; then - find . \( -name '*.dep' \) -print | xargs -t rm -elif [ $# -eq 1 ]; then - echo "Removing all dep files containing $1..." - find . -name '*.dep' -exec grep "$1" '{}' \; -exec rm '{}' \; +if [ $# -eq 0 ] +then + find . \( -name '*.dep' \) -print | xargs -t rm +elif [ $# -eq 1 ] +then + echo "Removing all dep files containing $1..." + find . -name '*.dep' -exec grep "$1" '{}' \; -exec rm '{}' \; else - echo "Usage: `basename $0` to remove all .dep files" - echo " `basename $0` to remove all .dep files referring to " - exit 1 + echo "Usage: ${0##/} to remove all .dep files" + echo " ${0##/} to remove all .dep files referring to " + exit 1 fi + diff --git a/bin/rm~all b/bin/rm~all index 73ea1d5569..6ee2bad370 100755 --- a/bin/rm~all +++ b/bin/rm~all @@ -1,3 +1,3 @@ #!/bin/sh -#find . \( -name '*~' -o -name '.*~' \) -exec ls -l {} \; -exec rm {} \; +# find . \( -name '*~' -o -name '.*~' \) -exec ls -l {} \; -exec rm {} \; find . \( -name '*~' -o -name '.*~' \) -print | xargs -t rm