Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
aad9dff0
Commit
aad9dff0
authored
1 year ago
by
Mark OLESEN
Browse files
Options
Downloads
Patches
Plain Diff
CONFIG: foamPackRelease handling of recursive submodules
parent
3154b776
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/tools/foamPackRelease
+65
-28
65 additions, 28 deletions
bin/tools/foamPackRelease
with
65 additions
and
28 deletions
bin/tools/foamPackRelease
+
65
−
28
View file @
aad9dff0
...
@@ -404,6 +404,68 @@ fi
...
@@ -404,6 +404,68 @@ fi
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Add in modules
# Add in modules
#
# Recursive addition of submodule content.
# NB: must be called from within the respective parent directory.
# Example,
#
# packModule abc (implied cd)
# packModule abc/def
# packModule abc/def/hij
#
packModule
()
{
local
parent
=
"
$1
"
if
[
-n
"
$parent
"
]
then
(
cd
"
${
parent
##*/
}
"
2>/dev/null
||
exit
git ls-tree HEAD |
\
while
read
mode gittype sha1 module
do
[
"
$gittype
"
==
commit
]
||
continue
case
"
$module
"
in
(
.
|
./
)
echo
"# module not initialized? :
$parent
"
continue
;;
esac
echo
echo
"# module"
echo
"module=
\"
"
$parent
${
parent
:+/
}
$module
"
\"
"
echo
"commit=
\"
"
$sha1
"
\"
"
echo
"tmpTarFile=
\"
"
$tarName
-
${
module
##*/
}
".tar
\"
"
echo
echo
'('
echo
'cd "$module" || exit'
echo
'newPrefix="$prefixDir${prefixDir:+/}$module"'
echo
'git -c tar.umask=user archive --format=tar --prefix="$newPrefix/" -o "$outputDir/$tmpTarFile" "$commit" || exit'
echo
'# Without test, validation dirs (potentially large)'
echo
'tar --delete -f "$outputDir/$tmpTarFile" "$newPrefix/test" "$newPrefix/validation" 2>/dev/null'
echo
'tar -Af "$outputDir/$tarName.tar" "$outputDir/$tmpTarFile"'
echo
'rm -f "$outputDir/$tmpTarFile"'
echo
'{'
echo
' echo'
echo
' echo "$module"'
echo
' echo commit="$commit"'
echo
' echo'
echo
' # Without test, validation dirs'
echo
' git ls-tree -r "$commit" | sed -e '
"'"
'/\ttest\//d;/\tvalidation\//d'
"'"
echo
'} >> "$outputDir/$manifest1"'
echo
')'
packModule
"
$parent
/
$module
"
done
)
fi
}
if
[
"
$withModules
"
!=
false
]
if
[
"
$withModules
"
!=
false
]
then
then
echo
echo
...
@@ -415,33 +477,7 @@ then
...
@@ -415,33 +477,7 @@ then
echo
' echo head="$head"'
echo
' echo head="$head"'
echo
'} > "$outputDir/$manifest1"'
echo
'} > "$outputDir/$manifest1"'
git
--git-dir
=
"
$gitbase
/.git"
ls-tree
"
$head
"
modules/ |
\
packModule modules
while
read
mode gittype sha1 module
do
[
"
$gittype
"
==
commit
]
||
continue
echo
echo
"module=
\"
"
$module
"
\"
"
echo
"commit=
\"
"
$sha1
"
\"
"
echo
"tarModule=
\"
"
$tarName
-
${
module
##*/
}
"
\"
"
echo
echo
'if pushd "$module"; then'
echo
'moduleDir="$prefixDir${prefixDir:+/}$module"'
echo
'git -c tar.umask=user archive --format=tar --prefix="$moduleDir/" -o "$outputDir/$tarModule.tar" "$commit"'
echo
'# Without test, validation dirs (potentially large)'
echo
'tar --delete -f "$outputDir/$tarModule.tar" "$moduleDir/test" "$moduleDir/validation" 2>/dev/null'
echo
'tar -Af "$outputDir/$tarName.tar" "$outputDir/$tarModule.tar"'
echo
'rm -f "$outputDir/$tarModule.tar"'
echo
'{'
echo
' echo'
echo
' echo "$module"'
echo
' echo commit="$commit"'
echo
' echo'
echo
' # Without test, validation dirs'
echo
' git ls-tree -r "$commit" | sed -e '
"'"
'/\ttest\//d;/\tvalidation\//d'
"'"
echo
'} >> "$outputDir/$manifest1"'
echo
'popd; fi'
done
echo
echo
echo
'{ echo; echo "# End"; } >> "$outputDir/$manifest1"'
echo
'{ echo; echo "# End"; } >> "$outputDir/$manifest1"'
...
@@ -459,8 +495,9 @@ echo 'rm -f "$buildInfo" "$manifest0" "$manifest1"'
...
@@ -459,8 +495,9 @@ echo 'rm -f "$buildInfo" "$manifest0" "$manifest1"'
echo
'popd; fi'
echo
'popd; fi'
echo
echo
echo
"# -----------------------"
echo
"# End of creating archive"
echo
"# End of creating archive"
echo
echo
"# -----------------------"
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Compression
# Compression
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment