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
c70d7237
Commit
c70d7237
authored
7 years ago
by
Mark OLESEN
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: more robust extraction of API number from wmake rules
parent
22775693
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wmake/wmakePrintBuild
+13
-26
13 additions, 26 deletions
wmake/wmakePrintBuild
with
13 additions
and
26 deletions
wmake/wmakePrintBuild
+
13
−
26
View file @
c70d7237
...
...
@@ -7,27 +7,12 @@
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
#-------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
# This file is part of OpenFOAM, licensed under GNU General Public License
# <http://www.gnu.org/licenses/>.
#
# Script
# wmakePrintBuild
#
# Usage
# wmakePrintBuild [OPTION]
#
# Description
# Print the version used when building the project
#
...
...
@@ -48,7 +33,7 @@ options:
-pkg TAG specify packager/release tag ('none' marks an empty packager)
-short report short version information (ie, without pkg tag)
-version VER specify an alternative version
-
plus
report wmake value of OPENFOAM
_PLUS and exit
-
api
report wmake value of OPENFOAM
/OPENFOAM_API/OPENFOAM_PLUS
-help
Print the version used when building the project, in this order of precedence:
...
...
@@ -76,7 +61,7 @@ die()
#------------------------------------------------------------------------------
# Parse arguments and options
#------------------------------------------------------------------------------
unset
checkOnly update package version opt
Plus
optShort
unset
checkOnly update package version opt
Api
optShort
while
[
"$#"
-gt
0
]
do
...
...
@@ -108,8 +93,8 @@ do
version
=
"
$2
"
shift
;;
-plus
)
opt
Plus
=
true
-api
|
-plus
)
opt
Api
=
true
break
;;
*
)
...
...
@@ -156,11 +141,13 @@ printTag()
# Get the version
#------------------------------------------------------------------------------
if
[
"
$opt
Plus
"
=
true
]
if
[
-n
"
$opt
Api
"
]
then
# Retrieve OPENFOAM_PLUS=<digits> from $WM_DIR/rules/General/general
# Extract API version from $WM_DIR/rules/General/general
# Any of OPENFOAM=<digits>, OPENFOAM_API=<digits>, OPENFOAM_COM=<digits>
# OPENFOAM_PLUS=<digits>
version
=
$(
sed
-ne
's@^.*OPENFOAM_PLUS=\([0-9][0-9]*\).*@\
1
@p'
\
sed
-ne
's@^.*OPENFOAM
\(_API|_COM|
_PLUS
\)*
=\([0-9][0-9]*\).*@\
2
@p'
\
$WM_DIR
/rules/General/general 2>/dev/null
)
...
...
@@ -169,7 +156,7 @@ then
echo
"
$version
"
exit
0
else
echo
"no wmake definition for OPENFOAM
_PLUS
"
1>&2
echo
"no wmake definition for OPENFOAM
API
"
1>&2
exit
1
fi
elif
[
-n
"
$version
"
]
...
...
@@ -200,7 +187,7 @@ fi
# Retrieve old values (oldPackage oldVersion)
getOldValues
if
[
"
$optShort
"
=
true
]
if
[
-n
"
$optShort
"
]
then
unset
package oldPackage
fi
...
...
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