From a823a5e9e66c9a5fa3a871042323f77461d34fb0 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 28 Aug 2007 09:47:21 +0000 Subject: [PATCH] Made the release-announce script distro-neutral (it had been hardcoded for docbook-xsl/ns releases), and refined the handling of message bodies for release announcements. --- releasetools/Targets.mk | 4 +- releasetools/Variables.mk | 1 + releasetools/release-announce | 93 ++++++++++++----------------------- releasetools/xslns.mk | 3 ++ 4 files changed, 38 insertions(+), 63 deletions(-) diff --git a/releasetools/Targets.mk b/releasetools/Targets.mk index 177613300..2075ed1a1 100644 --- a/releasetools/Targets.mk +++ b/releasetools/Targets.mk @@ -227,8 +227,8 @@ install: tag upload-to-sf-incoming upload-to-project-webspace @echo @echo " http://sourceforge.net/project/admin/editpackages.php?group_id=21935" -announce: RELEASE-NOTES-PARTIAL.txt - $(RELEASE_ANNOUNCE) $(RELVER) $(ANNOUNCE_RECIPIENTS) +announce: RELEASE-NOTES-PARTIAL.txt .announcement-text distrib + $(RELEASE_ANNOUNCE) "$(DISTRO_TITLE)" "$(RELVER)" "$(ANNOUNCE_RECIPIENTS)" < .announcement-text tag: ifeq (,$(shell svn status)) diff --git a/releasetools/Variables.mk b/releasetools/Variables.mk index e24a7d944..58c6453aa 100644 --- a/releasetools/Variables.mk +++ b/releasetools/Variables.mk @@ -70,6 +70,7 @@ SVNLOG2DOCBOOK=$(DOCBOOK_SVN)/releasetools/svnlog2docbook.xsl SVN_INFO_FILE=.svninfo.xml PREVIOUS_RELEASE=$(shell $(XSLTPROC) --stringparam get PreviousRelease VERSION VERSION) +DISTRO_TITLE=$(shell $(XSLTPROC) --stringparam get DistroTitle VERSION VERSION) REPOSITORY_ROOT=$(shell if [ -f $(SVN_INFO_FILE) ]; then $(XSLTPROC) --stringparam expression //root $(EVALXPATH) $(SVN_INFO_FILE); fi) DISTRO_URL=$(shell if [ -f $(SVN_INFO_FILE) ]; then $(XSLTPROC) --stringparam expression //url $(EVALXPATH) $(SVN_INFO_FILE); fi) diff --git a/releasetools/release-announce b/releasetools/release-announce index 3d8cbb552..990533aab 100755 --- a/releasetools/release-announce +++ b/releasetools/release-announce @@ -1,70 +1,41 @@ #!/bin/sh # $Id$ -# release-announce VERSION RECIPIENTS -# e.g., release-announce 1.73.0 docbook-apps@lists.oasis-open.org - -version=$1 -recipients=$2 - -rm -f /tmp/HEADER.txt -rm -f /tmp/HEADER-NS.txt -rm -f /tmp/BODY-DOCS.txt - -cat <<- EOF > /tmp/HEADER.txt -From: DocBook Project +# release-announce - send DocBook Project release announcements + +# Usage: +# release-announce TITLE VERSION RECIPIENTS < messageBodyFile +# or +# cat messageBodyFile | release-announce TITLE VERSION RECIPIENTS +# +# e.g., +# release-announce XSL Stylesheets 1.73.0 docbook-apps@lists.oasis-open.org < .announcement-text + +title=$1 +version=$2 +recipients=$3 +sender=docbook-dev@xml-doc.org +tempfile=/tmp/announcement-message-body.txt +releasenotesfilename=RELEASE-NOTES-PARTIAL.txt + +rm -f $tempfile + +cat <<- EOF > $tempfile +From: DocBook Project <$sender> To: $recipients -Subject: ANNOUNCE: DocBook XSL $version released - -The DocBook Project wishes to announce that version $version of the -DocBook XSL Stylesheets is now available for download from the -project website: - - http://docbook.sf.net/files/xsl/latest - http://sourceforge.net/projects/docbook - -The DocBook XSL Stylesheets are designed for processing -non-namespaced (DocBook 4 or earlier) documents. +Subject: ANNOUNCE: DocBook $title $version released EOF -cat <<- EOF > /tmp/HEADER-NS.txt -From: DocBook Project -To: $recipients -Subject: ANNOUNCE: DocBook XSL-NS $version released - -The DocBook Project wishes to announce that version $version of the -DocBook XSL-NS Stylesheets is now available for download from the -project website: - - http://docbook.sf.net/files/xsl-ns/latest - http://sourceforge.net/projects/docbook - -The DocBook XSL-NS Stylesheets are designed for processing -namespaced (DocBook 5) documents. +# read in annoucement text +while read line +do + # substitute actual version no. where needed, append to message body + echo $line | sed "s/@@version@@/$version/" >> $tempfile +done -EOF - -cat <<- EOF > /tmp/BODY-DOCS.txt -The reference docs are packaged separately and downloadable from: - - http://docbook.sf.net/files/xsl-doc/latest - -The docs are also available online: - - http://docbook.sf.net/release/xsl/current/doc/reference.html - http://docbook.sf.net/release/xsl/current/doc/reference.pdf - http://docbook.sf.net/release/xsl/current/doc/reference.txt - -The release notes are included below. HTML and PDF versions of the -release notes are also available: - - http://docbook.sf.net/release/xsl/current/RELEASE-NOTES.html - http://docbook.sf.net/release/xsl/current/RELEASE-NOTES.pdf - -EOF +# add a blank line to separate announcement header and text from +# appended release-notes content +echo >> $tempfile -cat /tmp/HEADER.txt /tmp/BODY-DOCS.txt RELEASE-NOTES-PARTIAL.txt \ - | sendmail -v -f docbook-dev@xml-doc.org $recipients -cat /tmp/HEADER-NS.txt /tmp/BODY-DOCS.txt RELEASE-NOTES-PARTIAL.txt \ - | sendmail -v -f docbook-dev@xml-doc.org $recipients +cat $tempfile $releasenotesfilename | sendmail -v -f $sender $recipients diff --git a/releasetools/xslns.mk b/releasetools/xslns.mk index 35d01adc3..af2376dc2 100644 --- a/releasetools/xslns.mk +++ b/releasetools/xslns.mk @@ -99,3 +99,6 @@ install-ns: upload-to-sf-incoming upload-to-project-webspace-ns @echo "Use the following form to move the uploaded files to the project release area." @echo @echo " http://sourceforge.net/project/admin/editpackages.php?group_id=21935" + +announce-ns: announce + $(RELEASE_ANNOUNCE) "XSL-NS Stylesheets" "$(RELVER)" "$(ANNOUNCE_RECIPIENTS)" < $(DOCBOOK_SVN)/releasetools/xslnsfiles/announcement-text -- 2.40.0