2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
8 #-------------------------------------------------------------------------------
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by
14 # the Free Software Foundation, either version 3 of the License, or
15 # (at your option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 # foamPackDeps [OPTION]
29 # Pack and compress *.dep files from OpenFOAM
32 # foamPackDeps [OPTION]
35 # Pack and compress *.dep files from OpenFOAM ThirdParty
37 #------------------------------------------------------------------------------
38 toolsDir
="${0%/*}/tools" # this script is located in the tools/ parent dir
43 codeBase
="OpenFOAM ThirdParty"
44 packDir
=ThirdParty-
$WM_PROJECT_VERSION
49 packDir
=$WM_PROJECT-$WM_PROJECT_VERSION
56 while [ "$#" -gt 0 ]; do echo "$1"; shift; done
58 Usage: ${0##*/} [OPTION]
60 -b, -bzip2 use bzip2 instead of gzip compression
61 -c, -current for compatibility - currently ignored
62 -o, -output <dir> specify alternative output directory
64 * Pack and compress *.dep files from $codeBase
71 unset archOptions outputDir
85 -c |
-current) # use $WM_OPTIONS - eg, 'linux64GccDPOpt'
86 archOptions
="$WM_OPTIONS"
90 [ "$#" -ge 2 ] || usage
"'$1' option requires an argument"
95 usage
"unknown option: '$*'"
103 # check for essential directories
105 echo "Error: directory $packDir does not exist" 1>&2
110 #------------------------------------------------------------------------------
111 timeStamp
=$
(date +%Y-
%m-
%d
)
112 packBase
=${packDir}.deps_
${timeStamp}
114 # add optional output directory
115 [ -d "$outputDir" ] && packBase
="$outputDir/$packBase"
116 packFile
=$packBase.
$packExt
118 # avoid overwriting old pack file
121 echo "Error: $packFile already exists" 1>&2
126 -------------------------------------------------------------------------------
127 Packing *.dep files into $packFile
132 # bzip2 or gzip compression
144 trap 'rm -f $packFile 2>/dev/null' INT
146 find -H $packDir -name '*.dep' -type f
-print |
tar $tarOpt $packFile -T -
150 echo "Finished packing *.dep files into $packFile" 1>&2
152 echo "Error: failure packing *.dep files into $packFile" 1>&2
153 rm -f $packFile 2>/dev
/null
156 #------------------------------------------------------------------------------