website-doc.sh: include maintenance releases in the list of announces

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2016-06-08 03:21:28 +02:00
parent 744974584a
commit 344cc07f7a

View File

@ -62,6 +62,25 @@ function api () {
#
# Return title from release entry.
# $1: full release title
#
function parse_releases_get_link () {
echo $1 | sed -r -e 's,^### (OfflineIMAP.*)\),\1,'
| tr '[:upper:]' '[:lower:]' \
| sed -r -e 's,[\.("],,g' \
| sed -r -e 's, ,-,g'
}
#
# Return version from release entry.
# $1: full release title
#
function parse_releases_get_version () {
echo $title | sed -r -e 's,^### [a-Z]+ (v[^ ]+).*,\1,'
}
#
# Make Changelog public and save links to them as JSON.
#
@ -76,18 +95,20 @@ function releases () {
# - {version: '<version>', link: '<link>'}
# - ...
echo "$HEADER" > "$ANNOUNCES_YML"
# Announces for the mainline.
grep -E '^### OfflineIMAP' ./Changelog.md | while read title
do
link="$(echo $title | sed -r -e 's,^### (OfflineIMAP.*)\),\1,' \
| tr '[:upper:]' '[:lower:]' \
| sed -r -e 's,[\.("],,g' \
| sed -r -e 's, ,-,g'
)"
v="$(echo $title \
| sed -r -e 's,^### [a-Z]+ (v[^ ]+).*,\1,'
)"
link="$(parse_releases_get_link $title)"
v="$(parse_releases_get_version $title)"
echo "- {version: '${v}', link: 'Changelog.html#${link}'}"
done | tee -a "$ANNOUNCES_YML"
# Announces for the maintenance releases.
grep -E '^### OfflineIMAP' ./Changelog.maint.md | while read title
do
link="$(parse_releases_get_link $title)"
v="$(parse_releases_get_version $title)"
echo "- {version: '${v}', link: 'Changelog.maint.html#${link}'}"
done | tee -a "$ANNOUNCES_YML"
}