diff --git a/bin/foamPack b/bin/foamPack index 9688cd039e..e3d090e2f2 100755 --- a/bin/foamPack +++ b/bin/foamPack @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -107,15 +107,23 @@ then echo "pack manually" 1>&2 foamPackSource $packDir $packFile else - echo "pack with git-archive" 1>&2 - ( cd $packDir && git archive --format=tar --prefix=$packDir/ HEAD) > $packBase.tar + if [ ! -f $packDir/.build ] + then + echo "Error: $packDir/.build does not exists" 1>&2 + echo " Please update this by running e.g. 'wmakePrintBuild -update' in $packDir" 1>&2 + exit 2 + fi - echo "add in time-stamp and lnInclude directories" 1>&2 - tar cf $packBase.tar2 $packDir/.timeStamp $packDir/.build `find -H $packDir -type d -name lnInclude` - tar Af $packBase.tar $packBase.tar2 - echo "gzip tar file" 1>&2 - gzip -c9 $packBase.tar > $packFile + echo "pack with git-archive" 1>&2 && + ( cd $packDir && git archive --format=tar --prefix=$packDir/ HEAD) > $packBase.tar && + + echo "add in time-stamp and lnInclude directories" 1>&2 && + tar cf $packBase.tar2 $packDir/.timeStamp $packDir/.build `find -H $packDir -type d -name lnInclude` && + tar Af $packBase.tar $packBase.tar2 && + + echo "gzip tar file" 1>&2 && + gzip -c9 $packBase.tar > $packFile && rm -f $packBase.tar $packBase.tar2 2>/dev/null fi