diff --git a/bin/foamPack b/bin/foamPack index 3faa48cfdf3e8388e201a3fdb997d67535741648..5c22d5849a5fef4b2060348af5b2d8ab476e5aa8 100755 --- a/bin/foamPack +++ b/bin/foamPack @@ -37,8 +37,8 @@ usage() { cat <<USAGE 1>&2 Usage: ${0##*/} [OPTION] options: - -o <dir> specify alternative output directory - -nogit bypass using 'git archive' + -o, -output <dir> specify alternative output directory + -nogit bypass using 'git archive' * Pack and compress OpenFOAM directory for release @@ -46,7 +46,7 @@ USAGE exit 1 } -unset prefix outputDir nogit +unset outputDir nogit # parse options while [ "$#" -gt 0 ] do diff --git a/bin/foamPackBin b/bin/foamPackBin index 2cd739b81827a42c46575beea2bc08de1cc188d1..67738d1ea82a9c29164cb240afc3078b69412692 100755 --- a/bin/foamPackBin +++ b/bin/foamPackBin @@ -57,8 +57,10 @@ usage() { while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done cat <<USAGE 1>&2 Usage: ${0##*/} [OPTION] <archOptions> + ${0##*/} [OPTION] -current options: - -o <dir> specify alternative output directory + -c, -current use current value of \$WM_OPTIONS + -o, -output <dir> specify alternative output directory * Pack and compress binary version of $codeBase for release @@ -70,7 +72,8 @@ USAGE } -unset prefix outputDir +unset archOptions outputDir + # parse options while [ "$#" -gt 0 ] do @@ -78,6 +81,10 @@ do -h | -help) usage ;; + -c | -current) # use $WM_OPTIONS - eg, 'linux64GccDPOpt' + archOptions="$WM_OPTIONS" + shift + ;; -o | -output) [ "$#" -ge 2 ] || usage "'$1' option requires an argument" outputDir=${2%%/} @@ -92,10 +99,14 @@ do esac done -[ $# -eq 1 ] || usage "Error: specify architecture" +if [ -n "$archOptions" ] +then + [ $# -eq 0 ] || usage "Error: cannot specify both -current and architecture" +else + archOptions="$1" + [ $# -eq 1 ] || usage "Error: specify architecture" +fi -# same as $WM_OPTIONS - eg, 'linux64GccDPOpt' -archOptions="$1" #------------------------------------------------------------------------------ timeStamp=$(date +%Y-%m-%d) diff --git a/bin/foamPackDeps b/bin/foamPackDeps index 198c3a3b191c9b633c7381ad986d4eb597d88c9f..67a885b9002bd7ed47fb39f157e1106882258bc3 100755 --- a/bin/foamPackDeps +++ b/bin/foamPackDeps @@ -56,7 +56,7 @@ usage() { cat <<USAGE 1>&2 Usage: ${0##*/} [OPTION] options: - -o <dir> specify alternative output directory + -o, -output <dir> specify alternative output directory * Pack and compress *.dep files from $codeBase @@ -123,7 +123,7 @@ find -H $packDir -name '*.dep' -type f -print | tar cpzf $packFile -T - if [ $? -eq 0 ] then - echo "Finished packing *.dep files into file $packFile" 1>&2 + echo "Finished packing *.dep files into $packFile" 1>&2 else echo "Error: failure packing *.dep files into $packFile" 1>&2 rm -f $packFile 2>/dev/null diff --git a/bin/foamPackDoxygen b/bin/foamPackDoxygen index 464a5d523f33778701ef7a3b0be4b49a9f182345..6f1b17ca27a7a304e9920663e9da9d0ea3f9e058 100755 --- a/bin/foamPackDoxygen +++ b/bin/foamPackDoxygen @@ -37,8 +37,8 @@ usage() { cat <<USAGE 1>&2 Usage: ${0##*/} [OPTION] options: - -prefix <dir> use alternative prefix - -o <dir> specify alternative output directory + -o, -output <dir> specify alternative output directory + -prefix <dir> use alternative prefix * Pack and compress the OpenFOAM doxygen html for release @@ -54,14 +54,14 @@ do -h | -help) usage ;; - -prefix | --prefix) + -o | -output) [ "$#" -ge 2 ] || usage "'$1' option requires an argument" - prefix=${2%%/} + outputDir=${2%%/} shift 2 ;; - -o | -output) + -prefix | --prefix) [ "$#" -ge 2 ] || usage "'$1' option requires an argument" - outputDir=${2%%/} + prefix=${2%%/} shift 2 ;; -*) @@ -120,9 +120,9 @@ fi if [ $? -eq 0 ] then - echo "Finished packing doxygen html into file $packFile" 1>&2 + echo "Finished packing doxygen html into $packFile" 1>&2 else - echo "Error: failure packing doxygen html into file $packFile" 1>&2 + echo "Error: failure packing doxygen html into $packFile" 1>&2 rm -f $packFile 2>/dev/null fi diff --git a/bin/foamPackMake b/bin/foamPackMake index a3370867d067b734890f20d861a5d28087d2b20c..c4325723e34d04b7f8d056a6408ced07334e9981 100755 --- a/bin/foamPackMake +++ b/bin/foamPackMake @@ -55,8 +55,10 @@ usage() { while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done cat <<USAGE 1>&2 Usage: ${0##*/} [OPTION] <archOptions> + ${0##*/} [OPTION] -current options: - -o <dir> specify alternative output directory + -c, -current use current value of \$WM_OPTIONS + -o, -output <dir> specify alternative output directory * Pack and compress $codeBase Make/<archOptions> directories @@ -68,7 +70,8 @@ USAGE } -unset outputDir +unset archOptions outputDir + # parse options while [ "$#" -gt 0 ] do @@ -76,6 +79,10 @@ do -h | -help) usage ;; + -c | -current) # use $WM_OPTIONS - eg, 'linux64GccDPOpt' + archOptions="$WM_OPTIONS" + shift + ;; -o | -output) [ "$#" -ge 2 ] || usage "'$1' option requires an argument" outputDir=${2%%/} @@ -90,10 +97,14 @@ do esac done -[ $# -eq 1 ] || usage "Error: specify architecture" +if [ -n "$archOptions" ] +then + [ $# -eq 0 ] || usage "Error: cannot specify both -current and architecture" +else + archOptions="$1" + [ $# -eq 1 ] || usage "Error: specify architecture" +fi -# same as $WM_OPTIONS - eg, 'linux64GccDPOpt' -archOptions="$1" #------------------------------------------------------------------------------ timeStamp=$(date +%Y-%m-%d) diff --git a/bin/tools/foamPackSource b/bin/tools/foamPackSource index 55a7b3bbee07b760ba1e5f8c0aba38befb3c960a..a4d014cfcf0de3c45d410debe34a52d9d3058376 100755 --- a/bin/tools/foamPackSource +++ b/bin/tools/foamPackSource @@ -84,9 +84,9 @@ trap 'rm -f $packFile $tmpFile 2>/dev/null' INT tar cpzf $packFile --files-from $tmpFile if [ $? -eq 0 ] then - echo "Finished packing $packDir into file $packFile" 1>&2 + echo "Finished packing $packDir into $packFile" 1>&2 else - echo "Error: failure packing $packDir into file $packFile" 1>&2 + echo "Error: failure packing $packDir into $packFile" 1>&2 rm -f $packFile 2>/dev/null fi