Allow specifying release date in the pre-release script

This is useful when preparing a release in advance.
This commit is contained in:
Vadim Zeitlin 2022-09-03 14:50:04 +02:00
parent c6c6dacd64
commit d6c9040c4a

View file

@ -30,6 +30,14 @@ then
exit 1
fi
# Optional release-date argument can be specified if the release is not being
# done today.
if [[ -n $1 ]]
then
echo Using release date of $1
rel_date=--date=$1
fi
# Exit immediately if a command exits with a non-zero status.
set -e
@ -37,7 +45,7 @@ topdir=`dirname $0`/../..
# get the month name and the year, see $(date +'%B %Y')
# then use it in the relevant line (one before last)
sed -i "/^The wxWidgets Team, / s/.*/The wxWidgets Team, $(date +'%B %Y')/" $topdir/docs/readme.txt
sed -i "/^The wxWidgets Team, / s/.*/The wxWidgets Team, $(date ${rel_date} +'%B %Y')/" $topdir/docs/readme.txt
echo Updated date in docs/readme.txt
# reset checksums to a string of 40 0-s, see $(printf '%.40d' 0)
@ -46,15 +54,15 @@ echo Reset checksums in docs/release.md
# get current date, see $(date +'%Y-%m-%d')
# then use it in the line containing "X.X.X: (not released yet)"
sed -i "/^[3-9]\.[0-9]\.[0-9]: (not released yet)$/ s/not released yet/released $(date +'%Y-%m-%d')/" $topdir/docs/changes.txt
sed -i "/^[3-9]\.[0-9]\.[0-9]: (not released yet)$/ s/not released yet/released $(date ${rel_date} +'%Y-%m-%d')/" $topdir/docs/changes.txt
echo Updated release date in docs/changes.txt
# get current date, see $(date +'%B %d, %Y')
# then use it in the line starting with @date
sed -i "/^@date / s/.*/@date $(date +'%B %d, %Y')/" $topdir/docs/doxygen/mainpages/manual.h
sed -i "/^@date / s/.*/@date $(date ${rel_date} +'%B %d, %Y')/" $topdir/docs/doxygen/mainpages/manual.h
echo Updated date in docs/doxygen/mainpages/manual.h
# get current date, see $(date +'%B %d, %Y')
# then use it in the first line
sed -i "1s/^.* -- /$(date +'%B %d, %Y') -- /" $topdir/docs/publicity/announce.txt
sed -i "1s/^.* -- /$(date ${rel_date} +'%B %d, %Y') -- /" $topdir/docs/publicity/announce.txt
echo Updated date in docs/publicity/announce.txt