mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support bzip2 compression for foamPack*
This commit is contained in:
@ -71,6 +71,8 @@ find -H $packDir \
|
||||
-a ! -name "*.tar" \
|
||||
-a ! -name "*.tar.gz" \
|
||||
-a ! -name "*.tgz" \
|
||||
-a ! -name "*.tar.bz2" \
|
||||
-a ! -name "*.tbz" \
|
||||
-a ! -name "core" \
|
||||
-a ! -name "core.[1-9]*" \
|
||||
-a ! -name "libccmio*" \
|
||||
|
||||
@ -78,10 +78,20 @@ INFO
|
||||
wc $tmpFile | awk '{print "Packing",$1,"files - this could take some time ..."}' 1>&2
|
||||
|
||||
|
||||
# bzip2 or gzip compression
|
||||
case "$packFile" in
|
||||
*tbz)
|
||||
tarOpt=cpjf
|
||||
;;
|
||||
*)
|
||||
tarOpt=cpzf
|
||||
;;
|
||||
esac
|
||||
|
||||
# Clean up on Ctrl-C
|
||||
trap 'rm -f $packFile $tmpFile 2>/dev/null' INT
|
||||
|
||||
tar cpzf $packFile --files-from $tmpFile
|
||||
tar $tarOpt $packFile --files-from $tmpFile
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "Finished packing $packDir into $packFile" 1>&2
|
||||
|
||||
Reference in New Issue
Block a user