From 67bdbf1bbf89cb0c490e7bdf6eac6fe92508f072 Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Sat, 10 Aug 2024 16:11:14 -0700 Subject: [PATCH] stable/20240000: check_version.sh: current master version set by new_release.sh. --- bin/check_version.sh | 41 +++++++++++++++++++---------------------- user_guide.xrst | 4 ++-- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/bin/check_version.sh b/bin/check_version.sh index 92bd10457..9bc4a5a2d 100755 --- a/bin/check_version.sh +++ b/bin/check_version.sh @@ -40,8 +40,8 @@ check_version() { } # ----------------------------------------------------------------------------- # -# version -version=$( +# this_version +this_version=$( sed -n -e '/^SET( *cppad_version *"[0-9.]*")/p' CMakeLists.txt | \ sed -e 's|.*"\([^"]*\)".*|\1|' ) @@ -49,18 +49,26 @@ version=$( # branch branch=$(git branch | sed -n -e '/^[*]/p' | sed -e 's|^[*] *||') # -# version +# this_version if [ "$branch" == 'master' ] then - version=$( date +%Y%m%d ) + this_version=$( date +%Y%m%d ) fi +# +# stable_version, release_version if echo $branch | grep '^stable/' > /dev/null then - if ! echo $version | grep '^[0-9]\{4\}0000[.]' > /dev/null + if ! echo $this_version | grep '^[0-9]\{4\}0000[.]' > /dev/null then echo 'check_version.sh: Stable version does not begin with yyyy0000.' exit 1 fi + release_version="$this_version" + stable_version=$(echo $release_version | sed -e 's|[.][0-9]*$||') +else + eval $(grep '^stable_version=' bin/new_release.sh) + eval $(grep '^release=' bin/new_release.sh) + release_version="$stable_version.$release" fi # # version_ok @@ -73,30 +81,19 @@ version_files=' ' # # temp.sed -if echo $branch | grep '^stable/' > /dev/null -then - stable=$( echo $version | sed -e 's|[.][0-9]*$||' ) cat << EOF > temp.sed -# # CMakeLists.txt -s|^SET( *cppad_version *"[0-9.]*")|SET(cppad_version "$version")| +s|^SET( *cppad_version *"[0-9.]*")|SET(cppad_version "$this_version")| # # user_guide.xrst -s|[0-9]\\{8\\}[.][0-9]*|$version|g -s|documentation-[0-9]\\{8\\}|documentation-latest|g -s|stable-[0-9]\\{8\\}|latest|g -s|cppad-[0-9]\\{8\\}[0-9.]*|cppad-$stable|g -EOF -else -cat << EOF > temp.sed +s|cppad-[0-9]\\{8\\}[.]*[.0-9]*|cppad-$this_version| # -# CMakeLists.txt -s|^SET( *cppad_version *"[0-9.]*")|SET(cppad_version "$version")| +s|release-[0-9]\\{8\\}\.[.0-9]*|release-$release_version| +s|archive/[0-9]\\{8\\}\.[0-9]*|archive/$release_version| # -# user_guide.xrst -s|cppad-[0-9]\\{8\\}|cppad-$version|g +s|documentation-[0-9]\\{8\\}|documentation-$stable_version| +s|stable-[0-9]\\{8\\}|stable-$stable_version| EOF -fi # for file in $version_files do diff --git a/user_guide.xrst b/user_guide.xrst index d906e155e..2b291da98 100644 --- a/user_guide.xrst +++ b/user_guide.xrst @@ -12,8 +12,8 @@ {xrst_comment BEGIN: Before changing see new_release.sh and check_version.sh} -cppad-20240000: CppAD User's Manual -################################### +cppad-20240000.7: CppAD User's Manual +##################################### .. image:: {xrst_dir coin.png}