fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / bin / foamPackSource
blob0947236f903168a034cab9198b0cff61d3f4284d
1 #!/bin/sh
2 #------------------------------------------------------------------------------
3 # ========= |
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / O peration |
6 # \\ / A nd | Copyright held by original author
7 # \\/ M anipulation |
8 #------------------------------------------------------------------------------
9 # License
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 the
14 # Free Software Foundation; either version 2 of the License, or (at your
15 # 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
20 # for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM; if not, write to the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 # Script
27 # foamPackSource <directory> <tarFile>
29 # Description
30 # Packs and compresses the .C and .H files and Make/options
31 # and Make/files in a given directory.
33 #------------------------------------------------------------------------------
34 tmpFile=${TMPDIR:-/tmp}/foamPackFiles.$$
36 if [ $# -ne 2 ]
37 then
38 echo "Usage : ${0##*/} directory tarFile"
39 echo ""
40 echo "Packs all .C and .H files and Make/options and Make/files into"
41 echo "<tarFile>"
42 echo ""
43 exit 1
46 # canonical form (no double and no trailing dashes)
47 packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
48 packFile=$2
50 if [ ! -d $packDir ]
51 then
52 echo "Error: directory $packDir does not exist"
53 exit 1
56 if [ -f $packFile ]
57 then
58 echo "Error: $packFile already exists"
59 exit 1
62 # Clean up on termination and on Ctrl-C
63 trap 'rm -f $tmpFile 2>/dev/null; exit 0' EXIT TERM INT
65 find -H $packDir \
66 ! -type d \
67 \( -type f -o -type l \) \
68 ! -name "*~" \
69 -a ! -name ".*~" \
70 -a ! -name "*.orig" \
71 -a ! -name "*.dep" \
72 -a ! -name "*.o" \
73 -a ! -name "*.so" \
74 -a ! -name "*.a" \
75 -a ! -name "*.tgz" \
76 -a ! -name "core" \
77 -a ! -name "core.[1-9]*" \
78 -a ! -name "log[0-9]*" \
79 -a ! -name "libccmio*" \
80 -a ! -name "\.ebrowse" \
81 | sed \
82 -e "\@$packDir/.git/@d" \
83 -e "\@.svn/@d" \
84 -e "\@$packDir/lib/@d" \
85 -e '\@/\.git/@d' \
86 -e '\@/\.tags/@d' \
87 -e '\@applications/bin/@d' \
88 -e '\@wmake/bin/@d' \
89 -e '\@/t/@d' \
90 -e '\@/Make[.A-Za-z]*/[^/]*/@d'\
91 -e '\@/platforms/@d' \
92 -e '\@libccmio.*/@d' \
93 -e '\@/.svn/@d' \
94 -e "\@$packDir/ThirdParty/rpmBuild/@d"\
95 > $tmpFile
98 # provide some feedback
99 wc $tmpFile | awk '{print "Packing",$1,"files - this could take some time ..."}'
101 tar czpf $packFile --files-from $tmpFile
103 if [ $? -eq 0 ]
104 then
105 echo "Finished packing and compressing $packDir into file $packFile"
106 else
107 echo "Error: failure packing $packDir into file $packFile"
108 rm -f $packFile 2>/dev/null
111 #------------------------------------------------------------------------------