Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
feature-scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
Community
feature-scripts
Commits
ceb2655d
Commit
ceb2655d
authored
7 years ago
by
Mark OLESEN
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: align foamCreateModuleInclude with version from OpenFOAM repository
parent
e9c4f977
No related branches found
No related tags found
1 merge request
!2
Update master to match develop
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/foamCreateModuleInclude
+52
-16
52 additions, 16 deletions
modules/foamCreateModuleInclude
with
52 additions
and
16 deletions
modules/foamCreateModuleInclude
+
52
−
16
View file @
ceb2655d
...
...
@@ -73,7 +73,7 @@ do
''
)
# Ignore empty args
;;
-h
|
-help
)
-h
|
-help
*
)
usage
;;
-debug
)
...
...
@@ -178,11 +178,38 @@ else
fi
# Snapshot of aliases - sorted
printAlias
()
{
alias
|
sort
-f
}
# Snapshot of environment - without functions
# Sorted as non-OpenFOAM, WM_*, FOAM_*
printEnv
()
{
# Non FOAM_*, WM_* settings
echo
"# non-OpenFOAM"
env
|
sed
-n
-e
'\@^FOAM_@d'
-e
'\@^WM_@d'
-e
'\@^[^ {}]@p'
\
|
sort
-f
# WM_* settings
echo
"# OpenFOAM"
env
|
sed
-n
-e
'\@^WM_@p'
\
|
sort
-f
# FOAM_* settings
echo
"# OpenFOAM"
env
|
sed
-n
-e
'\@^FOAM_@p'
\
|
sort
-f
}
#
# Initial snapshot of the environment
,
without
any
functions
# Initial snapshot of the environment
(
without functions
)
#
env
|
sed
-n
-e
'/^[^ {}]/p'
|
sort
-f
>
$tmpFiles
.env.pre.log
alias
|
sort
-f
>
$tmpFiles
.alias.pre.log
printEnv
>
$tmpFiles
.env.pre.log
printAlias
>
$tmpFiles
.alias.pre.log
# OpenFOAM settings
.
$projectDir
/etc/bashrc
''
...
...
@@ -195,6 +222,9 @@ unset FOAM_JOB_DIR FOAM_RUN FOAM_SETTINGS FOAM_INST_DIR
unset
WM_PROJECT_USER_DIR WM_THIRD_PARTY_DIR
unset
SCOTCH_VERSION
# Also remove user directories as being unreliable
foamOldDirs
=
"
$CEI_HOME
$BOOST_ARCH_PATH
$CGAL_ARCH_PATH
$FFTW_ARCH_PATH
$MPI_ARCH_PATH
$SCOTCH_ARCH_PATH
\
$FOAM_SITE_APPBIN
$FOAM_SITE_LIBBIN
$WM_PROJECT_SITE
\
$FOAM_USER_APPBIN
$FOAM_USER_LIBBIN
"
...
...
@@ -222,11 +252,6 @@ unset ENSIGHT10_INPUT ENSIGHT10_READER
# Always consider site to be bogus. If needed, should be done elsewhere.
unset
FOAM_SITE_APPBIN FOAM_SITE_LIBBIN WM_PROJECT_SITE
# Make user directories more generic.
export
FOAM_USER_APPBIN
=
'$env(HOME)/OpenFOAM/$env(USER)-'
"
$WM_PROJECT_VERSION
/platforms/
$WM_OPTIONS
/bin"
export
FOAM_USER_LIBBIN
=
'$env(HOME)/OpenFOAM/$env(USER)-'
"
$WM_PROJECT_VERSION
/platforms/
$WM_OPTIONS
/lib"
# Remove non-essential aliases
unalias
wmDP 2>/dev/null
unalias
wmInt32 2>/dev/null
...
...
@@ -247,11 +272,22 @@ unalias util 2>/dev/null
#------------------------------------------------
# Generalize environment.
# This needs rethinking since it largely duplicates logic from the etc/config.sh/settings
rewriteEnv
()
{
sed
\
-e
's@^\(FOAM_USER_APPBIN=\).*@\1$env(HOME)/OpenFOAM/$env(USER)-$env(WM_PROJECT_VERSION)/platforms/$env(WM_OPTIONS)/bin@'
\
-e
's@^\(FOAM_USER_LIBBIN=\).*@\1$env(HOME)/OpenFOAM/$env(USER)-$env(WM_PROJECT_VERSION)/platforms/$env(WM_OPTIONS)/lib@'
\
;
}
#
# Updated snapshot of the environment
,
without
any
functions
# Updated snapshot of the environment
(
without functions
)
#
env
|
sed
-n
-e
'/^[^ {}]/p'
|
sort
-f
>
$tmpFiles
.env.post.log
alias
|
sort
-f
>
$tmpFiles
.alias.post.log
printEnv | rewriteEnv
>
$tmpFiles
.env.post.log
printAlias
>
$tmpFiles
.alias.post.log
# Create a diff of the environment and aliases
diff
$tmpFiles
.env.pre.log
$tmpFiles
.env.post.log
>
$tmpFiles
.env.diff.log
...
...
@@ -259,7 +295,7 @@ diff $tmpFiles.alias.pre.log $tmpFiles.alias.post.log > $tmpFiles.alias.diff.lo
echo
"# -------------------"
>
$moduleOutput
# -------------------
# -------------------
-------------------------------
# Environment other than PATH, LD_LIBRARY_PATH
echo
"# Environment"
>>
$moduleOutput
grep
'> '
$tmpFiles
.env.diff.log |
\
...
...
@@ -270,7 +306,7 @@ sed \
-e
's/=/ "/'
-e
's/$/\"/'
>>
$moduleOutput
# -------------------
# -------------------
-------------------------------
# Changes in PATH - without junk and system directories
echo
"# PATH"
>>
$moduleOutput
...
...
@@ -290,9 +326,9 @@ sed \
-e
's/^/append-path PATH "/'
\
-e
's/$/\"/'
\
$tmpFiles
.path.diff.log
>>
$moduleOutput
# -------------------
# -------------------
-------------------------------
# -------------------
# -------------------
-------------------------------
# Changes in LD_LIBRARY_PATH - without junk and system directories
echo
"# LD_LIBRARY_PATH"
>>
$moduleOutput
...
...
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