CONFIG: Updated foamPackRelease for plugins directory support

This commit is contained in:
Andrew Heather
2024-05-31 12:40:07 +01:00
parent 74e118dd32
commit 5015883c01

View File

@ -49,6 +49,7 @@ options:
-output=DIR Output directory (default: ".") -output=DIR Output directory (default: ".")
-prefix=NAME Prefix directory within tar-file (default: auto) -prefix=NAME Prefix directory within tar-file (default: auto)
-pkg-modules Only package submodules - exclude OpenFOAM -pkg-modules Only package submodules - exclude OpenFOAM
-pkg-plugins Only package plugins - exclude OpenFOAM
-no-modules Exclude submodules -no-modules Exclude submodules
-no-patch Ignore '_patch' number for output tar-file -no-patch Ignore '_patch' number for output tar-file
-no-prefix Do not prefix subdirectory -no-prefix Do not prefix subdirectory
@ -93,7 +94,7 @@ die()
outputDir="." outputDir="."
versionSeparator='_' versionSeparator='_'
withPatchNum=true withPatchNum=true
unset compress packageApi withSource withModules prefixDir tarName unset compress packageApi withSource withModules withPlugins prefixDir tarName
unset gitbase unset gitbase
# Cleanup tarName to remove trailing '.tar', detect compression etc # Cleanup tarName to remove trailing '.tar', detect compression etc
@ -148,10 +149,17 @@ do
;; ;;
-pkg-modules) -pkg-modules)
withModules=true withModules=true
withPlugins=false
withSource=false withSource=false
;; ;;
-no-modules) -pkg-plugins)
withModules=false withModules=false
withPlugins=true
withSource=false
;;
-no-modules | -no-plugins)
withModules=false
withPlugins=false
withSource=true withSource=true
;; ;;
-no-patch) -no-patch)
@ -293,8 +301,13 @@ then
prefixDir="OpenFOAM-v${packageApi}" prefixDir="OpenFOAM-v${packageApi}"
if [ "$withSource" = false ] if [ "$withSource" = false ]
then then
if [ "$withPlugins" = true ]
then
prefixDir="OpenFOAM-plugins-v${packageApi}"
else
prefixDir="OpenFOAM-modules-v${packageApi}" prefixDir="OpenFOAM-modules-v${packageApi}"
fi fi
fi
elif [ "$prefixDir" = false ] elif [ "$prefixDir" = false ]
then then
unset prefixDir unset prefixDir
@ -322,8 +335,13 @@ case "$tarName" in
tarName="OpenFOAM-v${packageApi}" tarName="OpenFOAM-v${packageApi}"
if [ "$withSource" = false ] if [ "$withSource" = false ]
then then
if [ "$withPlugins" = true ]
then
tarName="OpenFOAM-plugins-v${packageApi}"
else
tarName="OpenFOAM-modules-v${packageApi}" tarName="OpenFOAM-modules-v${packageApi}"
fi fi
fi
if [ "$withPatchNum" = false ] if [ "$withPatchNum" = false ]
then then
@ -363,6 +381,7 @@ echo
echo 'buildInfo="${prefixDir}${prefixDir:+@}META-INFO@build-info"' echo 'buildInfo="${prefixDir}${prefixDir:+@}META-INFO@build-info"'
echo 'manifest0="${prefixDir}${prefixDir:+@}META-INFO@manifest.txt"' echo 'manifest0="${prefixDir}${prefixDir:+@}META-INFO@manifest.txt"'
echo 'manifest1="${prefixDir}${prefixDir:+@}META-INFO@modules-manifest.txt"' echo 'manifest1="${prefixDir}${prefixDir:+@}META-INFO@modules-manifest.txt"'
echo 'manifest2="${prefixDir}${prefixDir:+@}META-INFO@plugins-manifest.txt"'
echo '#--------' echo '#--------'
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
@ -373,6 +392,12 @@ then
echo 'unset manifest1' echo 'unset manifest1'
fi fi
if [ "$withPlugins" = false ]
then
echo '# No plugins'
echo 'unset manifest2'
fi
if [ "$withSource" = false ] if [ "$withSource" = false ]
then then
echo '# No OpenFOAM source (package modules exclusively)' echo '# No OpenFOAM source (package modules exclusively)'
@ -489,6 +514,30 @@ then
echo '{ echo; echo "# End"; } >> "$outputDir/$manifest1"' echo '{ echo; echo "# End"; } >> "$outputDir/$manifest1"'
fi fi
if [ "$withPlugins" != false ]
then
echo
echo '# Plugins'
echo '{'
echo ' echo "# OpenFOAM plugins"'
echo ' echo api="$api"'
echo ' echo patch="$patch"'
echo ' echo head="$head"'
echo '} > "$outputDir/$manifest2"'
# HACK
echo 'oldManifest1="$manifest1"'
echo 'manifest1="$manifest2"'
packModule plugins
# HACK RESTORE
echo 'manifest1="$oldManifest1"'
echo
echo '{ echo; echo "# End"; } >> "$outputDir/$manifest2"'
fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Add in build-info and manifest files # Add in build-info and manifest files
# Decode '@' in the names as '/' directory separator # Decode '@' in the names as '/' directory separator
@ -497,7 +546,7 @@ echo
echo "echo 'Adding build-info and manifest files'" echo "echo 'Adding build-info and manifest files'"
echo 'if pushd "$outputDir"; then' echo 'if pushd "$outputDir"; then'
echo "tar --owner=root --group=root --append --transform='s|@|/|g' -v -f \"\$tarName.tar\" \"\$buildInfo\" \"\$manifest0\" \"\$manifest1\"" echo "tar --owner=root --group=root --append --transform='s|@|/|g' -v -f \"\$tarName.tar\" \"\$buildInfo\" \"\$manifest0\" \"\$manifest1\""
echo 'rm -f "$buildInfo" "$manifest0" "$manifest1"' echo 'rm -f "$buildInfo" "$manifest0" "$manifest1" "$manifest2"'
echo 'popd; fi' echo 'popd; fi'
echo echo