2017-11-16 12:45:59 -05:00
|
|
|
#!/bin/bash
|
2017-03-22 20:55:24 -04:00
|
|
|
|
|
|
|
# build a list of English locales
|
|
|
|
declare -a locale_list=("en_GB" "en_US")
|
|
|
|
# get available en locales (including .utf8 and .UTF-8 ones)
|
|
|
|
declare -a en_locales=(`locale -a | grep '^C\|^POSIX\|^en_'`)
|
|
|
|
locale_list+=("${en_locales[@]}")
|
|
|
|
|
|
|
|
found=0
|
|
|
|
|
|
|
|
# set an English locale to get the month name
|
|
|
|
for i in "${locale_list[@]}"
|
|
|
|
do
|
|
|
|
LC_ALL="$i"
|
|
|
|
|
|
|
|
# check that setting the locale succeeded
|
|
|
|
# if it failed then LC_TIME would be empty
|
|
|
|
my_locale=`locale | grep LC_TIME | sed 's/.*"\(.*\)".*/\1/'`
|
|
|
|
if [ "$my_locale" = "$i" ]
|
|
|
|
then
|
|
|
|
echo Locale set to $i
|
|
|
|
found=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ $found = 0 ]
|
|
|
|
then
|
|
|
|
echo Could not set an appropriate locale
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-09-03 08:50:04 -04:00
|
|
|
# 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
|
|
|
|
|
2017-03-22 20:55:24 -04:00
|
|
|
# Exit immediately if a command exits with a non-zero status.
|
|
|
|
set -e
|
|
|
|
|
2017-11-16 12:49:45 -05:00
|
|
|
topdir=`dirname $0`/../..
|
|
|
|
|
2017-03-22 20:55:24 -04:00
|
|
|
# get the month name and the year, see $(date +'%B %Y')
|
|
|
|
# then use it in the relevant line (one before last)
|
2022-09-03 08:50:04 -04:00
|
|
|
sed -i "/^The wxWidgets Team, / s/.*/The wxWidgets Team, $(date ${rel_date} +'%B %Y')/" $topdir/docs/readme.txt
|
2017-03-22 20:55:24 -04:00
|
|
|
echo Updated date in docs/readme.txt
|
|
|
|
|
|
|
|
# reset checksums to a string of 40 0-s, see $(printf '%.40d' 0)
|
2017-11-16 12:49:45 -05:00
|
|
|
sed -i -E "/^\s*[0-9a-f]{40}\s{1,2}wx/ s/(\s*)[0-9a-f]{40}(\s{1,2}wx)/\1$(printf '%.40d' 0)\2/" $topdir/docs/release.md
|
2017-03-22 20:55:24 -04:00
|
|
|
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)"
|
2022-09-03 08:50:04 -04:00
|
|
|
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
|
2017-03-22 20:55:24 -04:00
|
|
|
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
|
2022-09-03 08:50:04 -04:00
|
|
|
sed -i "/^@date / s/.*/@date $(date ${rel_date} +'%B %d, %Y')/" $topdir/docs/doxygen/mainpages/manual.h
|
2017-03-22 20:55:24 -04:00
|
|
|
echo Updated date in docs/doxygen/mainpages/manual.h
|
|
|
|
|
|
|
|
# get current date, see $(date +'%B %d, %Y')
|
|
|
|
# then use it in the first line
|
2022-09-03 08:50:04 -04:00
|
|
|
sed -i "1s/^.* -- /$(date ${rel_date} +'%B %d, %Y') -- /" $topdir/docs/publicity/announce.txt
|
2017-03-22 20:55:24 -04:00
|
|
|
echo Updated date in docs/publicity/announce.txt
|