Skip to content

Commit 67bdbf1

Browse files
committed
stable/20240000: check_version.sh: current master version set by new_release.sh.
1 parent ba30fc6 commit 67bdbf1

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

bin/check_version.sh

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,35 @@ check_version() {
4040
}
4141
# -----------------------------------------------------------------------------
4242
#
43-
# version
44-
version=$(
43+
# this_version
44+
this_version=$(
4545
sed -n -e '/^SET( *cppad_version *"[0-9.]*")/p' CMakeLists.txt | \
4646
sed -e 's|.*"\([^"]*\)".*|\1|'
4747
)
4848
#
4949
# branch
5050
branch=$(git branch | sed -n -e '/^[*]/p' | sed -e 's|^[*] *||')
5151
#
52-
# version
52+
# this_version
5353
if [ "$branch" == 'master' ]
5454
then
55-
version=$( date +%Y%m%d )
55+
this_version=$( date +%Y%m%d )
5656
fi
57+
#
58+
# stable_version, release_version
5759
if echo $branch | grep '^stable/' > /dev/null
5860
then
59-
if ! echo $version | grep '^[0-9]\{4\}0000[.]' > /dev/null
61+
if ! echo $this_version | grep '^[0-9]\{4\}0000[.]' > /dev/null
6062
then
6163
echo 'check_version.sh: Stable version does not begin with yyyy0000.'
6264
exit 1
6365
fi
66+
release_version="$this_version"
67+
stable_version=$(echo $release_version | sed -e 's|[.][0-9]*$||')
68+
else
69+
eval $(grep '^stable_version=' bin/new_release.sh)
70+
eval $(grep '^release=' bin/new_release.sh)
71+
release_version="$stable_version.$release"
6472
fi
6573
#
6674
# version_ok
@@ -73,30 +81,19 @@ version_files='
7381
'
7482
#
7583
# temp.sed
76-
if echo $branch | grep '^stable/' > /dev/null
77-
then
78-
stable=$( echo $version | sed -e 's|[.][0-9]*$||' )
7984
cat << EOF > temp.sed
80-
#
8185
# CMakeLists.txt
82-
s|^SET( *cppad_version *"[0-9.]*")|SET(cppad_version "$version")|
86+
s|^SET( *cppad_version *"[0-9.]*")|SET(cppad_version "$this_version")|
8387
#
8488
# user_guide.xrst
85-
s|[0-9]\\{8\\}[.][0-9]*|$version|g
86-
s|documentation-[0-9]\\{8\\}|documentation-latest|g
87-
s|stable-[0-9]\\{8\\}|latest|g
88-
s|cppad-[0-9]\\{8\\}[0-9.]*|cppad-$stable|g
89-
EOF
90-
else
91-
cat << EOF > temp.sed
89+
s|cppad-[0-9]\\{8\\}[.]*[.0-9]*|cppad-$this_version|
9290
#
93-
# CMakeLists.txt
94-
s|^SET( *cppad_version *"[0-9.]*")|SET(cppad_version "$version")|
91+
s|release-[0-9]\\{8\\}\.[.0-9]*|release-$release_version|
92+
s|archive/[0-9]\\{8\\}\.[0-9]*|archive/$release_version|
9593
#
96-
# user_guide.xrst
97-
s|cppad-[0-9]\\{8\\}|cppad-$version|g
94+
s|documentation-[0-9]\\{8\\}|documentation-$stable_version|
95+
s|stable-[0-9]\\{8\\}|stable-$stable_version|
9896
EOF
99-
fi
10097
#
10198
for file in $version_files
10299
do

user_guide.xrst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
{xrst_comment BEGIN: Before changing see new_release.sh and check_version.sh}
1414

15-
cppad-20240000: CppAD User's Manual
16-
###################################
15+
cppad-20240000.7: CppAD User's Manual
16+
#####################################
1717

1818
.. image:: {xrst_dir coin.png}
1919

0 commit comments

Comments
 (0)