fixup foamPack* scripts

- handle ThirdParty-VERSION properly

- handle wmake/utilbin/ location

- should the wmake/rules/* really be packed with a binary distribution?
  I think this is just left over from before.
This commit is contained in:
Mark Olesen
2009-07-16 09:56:54 +02:00
parent 65d7aff96d
commit 375e968bd1
9 changed files with 105 additions and 91 deletions

4
.gitignore vendored
View File

@ -41,10 +41,6 @@ SunOS*Gcc*/
# reinstate wmake/rules that might look like build folders # reinstate wmake/rules that might look like build folders
!wmake/rules/*/ !wmake/rules/*/
# but do continue to ignore the derived wmake files
wmake/rules/*/dirToString
wmake/rules/*/wmkdep
# doxygen generated documentation # doxygen generated documentation
doc/[Dd]oxygen/html doc/[Dd]oxygen/html
doc/[Dd]oxygen/latex doc/[Dd]oxygen/latex

View File

@ -86,9 +86,10 @@ find -H $packDir \
-a ! -name "log[0-9]*" \ -a ! -name "log[0-9]*" \
-a ! -name "so_locations" \ -a ! -name "so_locations" \
| sed \ | sed \
-e "\@$packDir/.git/@d" \
-e "\@$packDir/lib/@d" \ -e "\@$packDir/lib/@d" \
-e '\@applications/bin/@d' \ -e '\@/\.git/@d' \
-e '\@applications/bin/@d' \
-e '\@wmake/utilbin/@d' \
-e '\@/t/@d' \ -e '\@/t/@d' \
-e '\@Make[.A-Za-z]*/[^/]*/@d' \ -e '\@Make[.A-Za-z]*/[^/]*/@d' \
-e '\@doc/[Dd]oxygen/html@d' \ -e '\@doc/[Dd]oxygen/html@d' \
@ -100,7 +101,7 @@ find -H $packDir \
tar czpf $packFile --files-from $tmpFile tar czpf $packFile --files-from $tmpFile
if [ $? = 0 ] if [ $? -eq 0 ]
then then
echo "Finished packing and compressing $packDir into file $packFile" echo "Finished packing and compressing $packDir into file $packFile"
else else

View File

@ -33,14 +33,17 @@
if [ $# -eq 0 ] if [ $# -eq 0 ]
then then
echo "Error: architecture type expected, exiting" echo "Error: architecture type expected, exiting"
echo echo
echo "Usage : ${0##*/} <arch> [outputDir]" echo "Usage : ${0##*/} <arch> [outputDir]"
echo echo
exit 1 exit 1
fi fi
arch=$1 arch=$1
# base arch (w/o precision, optimization, etc)
baseArch=$(echo "$arch" | sed -e 's@[DS]P.*$@@')
timeStamp=$(date +%Y-%m-%d) timeStamp=$(date +%Y-%m-%d)
packDir=$WM_PROJECT-$WM_PROJECT_VERSION packDir=$WM_PROJECT-$WM_PROJECT_VERSION
packFile=${packDir}.${arch}_${timeStamp}.gtgz packFile=${packDir}.${arch}_${timeStamp}.gtgz
@ -48,49 +51,50 @@ packFile=${packDir}.${arch}_${timeStamp}.gtgz
# add optional output directory # add optional output directory
if [ -d "$2" ] if [ -d "$2" ]
then then
packFile="$2/$packFile" packFile="$2/$packFile"
fi fi
if [ -f $packFile ] if [ -f $packFile ]
then then
echo "Error: $packFile already exists" echo "Error: $packFile already exists"
exit 1 exit 1
fi fi
# check for essential directories # check for essential directories
for dir in $packDir $packDir/lib/$arch $packDir/applications/bin/$arch for dir in $packDir $packDir/lib/$arch $packDir/applications/bin/$arch
do do
if [ ! -d $dir ] if [ ! -d $dir ]
then then
echo "Error: directory $dir does not exist" echo "Error: directory $dir does not exist"
exit 1 exit 1
fi fi
done done
# get list of directories # get list of directories
dirList=$( dirList=$(
for dir in \ for dir in \
$packDir/lib/$arch \ $packDir/lib/$arch \
$packDir/applications/bin/$arch \ $packDir/applications/bin/$arch \
$packDir/wmake/rules \ $packDir/wmake/rules \
; $packDir/wmake/utilbin/$baseArch \
do ;
[ -d $dir ] && echo $dir do
done [ -d $dir ] && echo $dir
done
) )
echo echo
echo "Packing $arch port of $packDir into $packFile" echo "Packing $arch ($baseArch) port of $packDir into $packFile"
echo echo
tar czpf $packFile $dirList tar czpf $packFile $dirList
if [ $? = 0 ] if [ $? -eq 0 ]
then then
echo "Finished packing and compressing file $packFile" echo "Finished packing and compressing file $packFile"
else else
echo "Error: failure packing $packFile" echo "Error: failure packing $packFile"
rm -f $packFile 2>/dev/null rm -f $packFile 2>/dev/null
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -34,14 +34,14 @@ packDir=$WM_PROJECT-$WM_PROJECT_VERSION
if [ ! -d $packDir ] if [ ! -d $packDir ]
then then
echo "Error: directory $packDir does not exist" echo "Error: directory $packDir does not exist"
exit 1 exit 1
fi fi
# obtain arch types from lib/ # obtain arch types from lib/
for bin in $packDir/lib/* for bin in $packDir/lib/*
do do
foamPackBin ${bin##*/} $@ foamPackBin ${bin##*/} $@
done done
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -41,7 +41,7 @@ Usage: ${0##*/} [-prefix DIR] [-o outputDir]
Packs and compresses the OpenFOAM doxygen html for release Packs and compresses the OpenFOAM doxygen html for release
USAGE USAGE
exit 1 exit 1
} }
unset prefix outputDir unset prefix outputDir
@ -87,16 +87,16 @@ fi
# #
if [ -d "$outputDir" ] if [ -d "$outputDir" ]
then then
packFile="$outputDir/$packDir$packTag" packFile="$outputDir/$packDir$packTag"
else else
packFile="$packDir$packTag" packFile="$packDir$packTag"
fi fi
if [ -f $packFile ] if [ -f $packFile ]
then then
echo "Error: $packFile already exists" echo "Error: $packFile already exists"
exit 1 exit 1
fi fi
# Pack and compress the packFile using GNU tar # Pack and compress the packFile using GNU tar
@ -107,16 +107,16 @@ echo
if [ -n "$prefix" ] if [ -n "$prefix" ]
then then
tar czpf $packFile --transform="s@^@$prefix/@" doc/Doxygen/html tar czpf $packFile --transform="s@^@$prefix/@" doc/Doxygen/html
else else
tar czpf $packFile $packDir/doc/Doxygen/html tar czpf $packFile $packDir/doc/Doxygen/html
fi fi
if [ $? = 0 ] if [ $? -eq 0 ]
then then
echo "Finished packing doxygen html into file $packFile" echo "Finished packing doxygen html into file $packFile"
else else
echo "Error: failure packing doxygen html file $packFile" echo "Error: failure packing doxygen html file $packFile"
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -37,20 +37,20 @@ packFile=${packDir}.General_${timeStamp}.gtgz
if [ ! -d $packDir ] if [ ! -d $packDir ]
then then
echo "Error: directory $packDir does not exist" echo "Error: directory $packDir does not exist"
exit 1 exit 1
fi fi
# add optional output directory # add optional output directory
if [ -d "$1" ] if [ -d "$1" ]
then then
packFile="$1/$packFile" packFile="$1/$packFile"
fi fi
if [ -f $packFile ] if [ -f $packFile ]
then then
echo "Error: $packFile already exists" echo "Error: $packFile already exists"
exit 1 exit 1
fi fi
# Create time stamp file # Create time stamp file
@ -62,7 +62,7 @@ echo $timeStamp 2>/dev/null > $packDir/.timeStamp
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo echo
echo "Packing $packDir into $packFile" echo "Packing $packDir source files into $packFile"
echo echo
foamPackSource $packDir $packFile foamPackSource $packDir $packFile

View File

@ -35,12 +35,12 @@ tmpFile=${TMPDIR:-/tmp}/foamPackFiles.$$
if [ $# -ne 2 ] if [ $# -ne 2 ]
then then
echo "Usage : ${0##*/} directory tarFile" echo "Usage : ${0##*/} directory tarFile"
echo "" echo ""
echo "Packs all .C and .H files and Make/options and Make/files into" echo "Packs all .C and .H files and Make/options and Make/files into"
echo "<tarFile>" echo "<tarFile>"
echo "" echo ""
exit 1 exit 1
fi fi
# canonical form (no double and no trailing dashes) # canonical form (no double and no trailing dashes)
@ -49,14 +49,14 @@ packFile=$2
if [ ! -d $packDir ] if [ ! -d $packDir ]
then then
echo "Error: directory $packDir does not exist" echo "Error: directory $packDir does not exist"
exit 1 exit 1
fi fi
if [ -f $packFile ] if [ -f $packFile ]
then then
echo "Error: $packFile already exists" echo "Error: $packFile already exists"
exit 1 exit 1
fi fi
# Clean up on termination and on Ctrl-C # Clean up on termination and on Ctrl-C
@ -78,24 +78,29 @@ find -H $packDir \
-a ! -name "log[0-9]*" \ -a ! -name "log[0-9]*" \
-a ! -name "libccmio*" \ -a ! -name "libccmio*" \
| sed \ | sed \
-e "\@$packDir/.git/@d" \
-e "\@/.tags/@d" \
-e "\@$packDir/lib/@d" \ -e "\@$packDir/lib/@d" \
-e "\@libccmio.*/@d" \ -e '\@/\.git/@d' \
-e '\@/\.tags/@d' \
-e '\@applications/bin/@d' \ -e '\@applications/bin/@d' \
-e '\@wmake/utilbin/@d' \
-e '\@/t/@d' \ -e '\@/t/@d' \
-e '\@/Make[.A-Za-z]*/[^/]*/@d'\ -e '\@/Make[.A-Za-z]*/[^/]*/@d'\
-e '\@/platforms/@d' \ -e '\@/platforms/@d' \
-e '\@libccmio.*/@d' \
> $tmpFile > $tmpFile
# provide some feedback
wc $tmpFile | awk '{print "Packing",$1,"files - this could take some time ..."}'
tar czpf $packFile --files-from $tmpFile tar czpf $packFile --files-from $tmpFile
if [ $? = 0 ] if [ $? -eq 0 ]
then then
echo "Finished packing and compressing $packDir into file $packFile" echo "Finished packing and compressing $packDir into file $packFile"
else else
echo "Error: failure packing $packDir into file $packFile" echo "Error: failure packing $packDir into file $packFile"
rm -f $packFile 2>/dev/null rm -f $packFile 2>/dev/null
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -31,36 +31,43 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
if [ $# = 0 ] if [ $# -eq 0 ]
then then
echo "Error: archOptions type expected, exiting" echo "Error: archOptions type expected, exiting"
echo echo
echo "Usage : ${0##*/} <archOptions> [outputDir]" echo "Usage : ${0##*/} <archOptions> [outputDir]"
echo echo
exit 1 exit 1
fi fi
archOptions=$1 archOptions=$1
arch=${archOptions%%G*} # TODO: works for Gcc only arch=${archOptions%%G*} # TODO: works for Gcc only
arch3264=$(echo "$arch" | sed 's@64@-64@') arch3264=$(echo "$arch" | sed -e 's@64@-64@')
echo "archOptions=$archOptions" echo "archOptions=$archOptions"
echo "arch=$arch" echo "arch=$arch"
echo "arch3264=$arch3264" echo "arch3264=$arch3264"
timeStamp=$(date +%Y-%m-%d) timeStamp=$(date +%Y-%m-%d)
packDir=ThirdParty packDir=${WM_THIRD_PARTY_DIR:-ThirdParty}
packDir=${packDir##*/}
packFile=${packDir}.${archOptions}_${timeStamp}.gtgz packFile=${packDir}.${archOptions}_${timeStamp}.gtgz
if [ ! -d $packDir ]
then
echo "Error: directory $packDir does not exist"
exit 1
fi
# add optional output directory # add optional output directory
if [ -d "$2" ] if [ -d "$2" ]
then then
packFile="$2/$packFile" packFile="$2/$packFile"
fi fi
if [ -f $packFile ] if [ -f $packFile ]
then then
echo "Error: $packFile already exists" echo "Error: $packFile already exists"
exit 1 exit 1
fi fi
# get list of directories # get list of directories
@ -71,12 +78,12 @@ echo
tar czpf $packFile $dirList tar czpf $packFile $dirList
if [ $? = 0 ] if [ $? -eq 0 ]
then then
echo "Finished packing and compressing file $packFile" echo "Finished packing and compressing file $packFile"
else else
echo "Error: failure packing $packFile" echo "Error: failure packing $packFile"
rm -f $packFile 2>/dev/null rm -f $packFile 2>/dev/null
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -32,25 +32,26 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d) timeStamp=$(date +%Y-%m-%d)
packDir=ThirdParty packDir=${WM_THIRD_PARTY_DIR:-ThirdParty}
packDir=${packDir##*/}
packFile=${packDir}.General_${timeStamp}.gtgz packFile=${packDir}.General_${timeStamp}.gtgz
if [ ! -d $packDir ] if [ ! -d $packDir ]
then then
echo "Error: directory $packDir does not exist" echo "Error: directory $packDir does not exist"
exit 1 exit 1
fi fi
# add optional output directory # add optional output directory
if [ -d "$1" ] if [ -d "$1" ]
then then
packFile="$1/$packFile" packFile="$1/$packFile"
fi fi
if [ -f $packFile ] if [ -f $packFile ]
then then
echo "Error: $packFile already exists" echo "Error: $packFile already exists"
exit 1 exit 1
fi fi
# Create time stamp file # Create time stamp file
@ -62,7 +63,7 @@ echo $timeStamp 2>/dev/null > $packDir/.timeStamp
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo echo
echo "Packing $packDir into $packFile" echo "Packing $packDir source files into $packFile"
echo echo
foamPackSource $packDir $packFile foamPackSource $packDir $packFile