From e05fc8ea83d9e73700e2314e9b3264f7c18710a1 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sat, 25 Mar 2006 17:32:46 +0000 Subject: [PATCH] Updated the release-notes and NEWS build to be based on XML output from cvs2cl and then use of an XSLT stylesheet to dynamically auto-generated the list of changes since the last release. --- releasetools/Targets.mk | 89 +++++++++++++++++++++++++++------------ releasetools/Variables.mk | 19 +++++++++ 2 files changed, 80 insertions(+), 28 deletions(-) diff --git a/releasetools/Targets.mk b/releasetools/Targets.mk index 72df0a60e..b87db5f12 100644 --- a/releasetools/Targets.mk +++ b/releasetools/Targets.mk @@ -3,16 +3,52 @@ # $Id$ +debug: + +ifeq ($(TAGVER),$(shell if [ -f LatestTag ]; then cat LatestTag; fi)) RELEASE-NOTES.html: RELEASE-NOTES.xml +else +RELEASE-NOTES.html: RELEASE-NOTES-$(TAGVER).xml +endif $(XSLT) $< $(DOC-LINK-STYLE) $@ RELEASE-NOTES.txt: RELEASE-NOTES.html LANG=C $(BROWSER) $(BROWSER_OPTS) $< > $@ +ifeq ($(TAGVER),$(shell if [ -f LatestTag ]; then cat LatestTag; fi)) RELEASE-NOTES.pdf: RELEASE-NOTES.xml +else +RELEASE-NOTES.pdf: RELEASE-NOTES-$(TAGVER).xml +endif $(XSLT) $< $(FO-STYLE) $(basename $<).fo $(FO_ENGINE).extensions=1 \ && $(FO_ENGINE) $(FO_ENGINE_OPTS) $(basename $<).fo +RELEASE-NOTES-$(TAGVER).xml: RELEASE-NOTES.xml NEWS.xml + $(XINCLUDE) $< > $@ + +NEWS.xml: ChangeLog.xml + $(XSLT) $< $(NEWS_MAKER) $@ \ + latest-tag="'$(shell cat LatestTag)'" \ + release-version="'$(RELVER)'" + +NEWS.html: NEWS.xml + $(XSLT) $< $(DOC-LINK-STYLE) $@ + +$(NEWSFILE): NEWS.html + LANG=C $(BROWSER) $(BROWSER_OPTS) $< > $@ + +ChangeLog.xml: LatestTag + $(CVS2CL) $(CVS2CL_OPTS) \ + --delta $(shell cat LatestTag):HEAD --xml -f $@ -g -q + +LatestTag: +# Note that one of the old commit messsage in the cvs log contains +# a ^Z (x1a) character, which is not legal in XML, so it must +# strip it out before using it with any XML processing apps + $(CVS2CL) $(CVS2CL_OPTS) --stdout --xml -g -q \ + | $(SED) $(SED_OPTS) 's/\x1a//g' \ + | $(XSLTPRC) $(GET_LATEST_TAG) - > $@ + .CatalogManager.properties.example: cp -p $(CATALOGMANAGER) .CatalogManager.properties.example @@ -32,14 +68,6 @@ install.sh: .CatalogManager.properties.example .urilist catalog.xml distrib: all $(DISTRIB_DEPENDS) RELEASE-NOTES.txt RELEASE-NOTES.pdf $(NEWSFILE) -$(NEWSFILE): - $(CVS2LOG) -w -ifeq ($(DIFFVER),) - $(MERGELOGS) > $(NEWSFILE) -else - $(MERGELOGS) -v $(DIFFVER) > $(NEWSFILE) -endif - newversion: ifeq ($(CVSCHECK),) ifeq ($(DIFFVER),) @@ -98,10 +126,10 @@ endif # Prepare *zip files for main part of distro # ----------------------------------------------------------------- rm -rf $(TMP)/docbook-$(DISTRO)-$(ZIPVER) - rm -f $(TMP)/tar.exclude - rm -f $(TMP)/docbook-$(DISTRO)-$(ZIPVER).tar.gz - rm -f $(TMP)/docbook-$(DISTRO)-$(ZIPVER).tar.bz2 - rm -f $(TMP)/docbook-$(DISTRO)-$(ZIPVER).zip + $(RM) $(TMP)/tar.exclude + $(RM) $(TMP)/docbook-$(DISTRO)-$(ZIPVER).tar.gz + $(RM) $(TMP)/docbook-$(DISTRO)-$(ZIPVER).tar.bz2 + $(RM) $(TMP)/docbook-$(DISTRO)-$(ZIPVER).zip umask 022; mkdir -p $(TMP)/docbook-$(DISTRO)-$(ZIPVER) touch $(TMP)/tar.exclude # distro-specific excludes @@ -125,7 +153,7 @@ endif umask 022; cd $(TMP) && $(TAR) cf$(TARFLAGS) - docbook-$(DISTRO)-$(ZIPVER) | gzip > docbook-$(DISTRO)-$(ZIPVER).tar.gz umask 022; cd $(TMP) && $(TAR) cf$(TARFLAGS) - docbook-$(DISTRO)-$(ZIPVER) | bzip2 > docbook-$(DISTRO)-$(ZIPVER).tar.bz2 umask 022; cd $(TMP) && zip -q -rpD docbook-$(DISTRO)-$(ZIPVER).zip docbook-$(DISTRO)-$(ZIPVER) - rm -f $(TMP)/tar.exclude + $(RM) $(TMP)/tar.exclude # ----------------------------------------------------------------- # Prepare *zip files for other parts of distro (if any) @@ -133,10 +161,10 @@ endif ifneq ($(DISTRIB_PACKAGES),) for part in $(DISTRIB_PACKAGES); do \ rm -rf $(TMP)/docbook-$(DISTRO)-$(ZIPVER); \ - rm -f $(TMP)/tar.exclude; \ - rm -f $(TMP)/docbook-$(DISTRO)-$$part-$(ZIPVER).tar.gz; \ - rm -f $(TMP)/docbook-$(DISTRO)-$$part-$(ZIPVER).tar.bz2; \ - rm -f $(TMP)/docbook-$(DISTRO)-$$part-$(ZIPVER).zip; \ + $(RM) $(TMP)/tar.exclude; \ + $(RM) $(TMP)/docbook-$(DISTRO)-$$part-$(ZIPVER).tar.gz; \ + $(RM) $(TMP)/docbook-$(DISTRO)-$$part-$(ZIPVER).tar.bz2; \ + $(RM) $(TMP)/docbook-$(DISTRO)-$$part-$(ZIPVER).zip; \ umask 022; mkdir -p $(TMP)/docbook-$(DISTRO)-$(ZIPVER); \ touch $(TMP)/tar.exclude; \ if [ -n "$(DISTRIB_EXCLUDES)" ]; then \ @@ -155,7 +183,7 @@ ifneq ($(DISTRIB_PACKAGES),) umask 022; (cd $(TMP) && $(TAR) cf$(TARFLAGS) - docbook-$(DISTRO)-$(ZIPVER) | gzip > docbook-$(DISTRO)-$$part-$(ZIPVER).tar.gz); \ umask 022; (cd $(TMP) && $(TAR) cf$(TARFLAGS) - docbook-$(DISTRO)-$(ZIPVER) | bzip2 > docbook-$(DISTRO)-$$part-$(ZIPVER).tar.bz2); \ umask 022; (cd $(TMP) && zip -q -rpD docbook-$(DISTRO)-$$part-$(ZIPVER).zip docbook-$(DISTRO)-$(ZIPVER)); \ - rm -f $(TMP)/tar.exclude; \ + $(RM) $(TMP)/tar.exclude; \ done endif endif @@ -176,17 +204,22 @@ install: zip rm -rf docbook-$(DISTRO)-$(ZIPVER).tar.bz2; \ rm -rf docbook-$(DISTRO)-*-$(ZIPVER).tar.bz2; \ chmod -R g+w $(ZIPVER); \ - rm -f current; \ + $(RM) current; \ ln -s $(ZIPVER) current; \ )" release-clean: clean - rm -f NEWS - rm -f RELEASE-NOTES.txt - rm -f RELEASE-NOTES.html - rm -f RELEASE-NOTES.fo - rm -f RELEASE-NOTES.pdf - rm -f install.sh - rm -f .CatalogManager.properties.example - rm -f .urilist - rm -f .make-catalog.xsl + $(RM) $(NEWSFILE) + $(RM) NEWS.html + $(RM) NEWS.xml + $(RM) RELEASE-NOTES-$(TAGVER).xml + $(RM) ChangeLog.xml + $(RM) LatestTag + $(RM) RELEASE-NOTES.txt + $(RM) RELEASE-NOTES.html + $(RM) RELEASE-NOTES.fo + $(RM) RELEASE-NOTES.pdf + $(RM) install.sh + $(RM) .CatalogManager.properties.example + $(RM) .urilist + $(RM) .make-catalog.xsl diff --git a/releasetools/Variables.mk b/releasetools/Variables.mk index 7ca1dfa33..caec63c7d 100644 --- a/releasetools/Variables.mk +++ b/releasetools/Variables.mk @@ -12,9 +12,28 @@ CATALOGMANAGER=$(DOCBOOK_CVS)/releasetools/.CatalogManager.properties.example INSTALL_SH=$(DOCBOOK_CVS)/releasetools/install.sh MAKECATALOG=$(DOCBOOK_CVS)/releasetools/make-catalog.xsl +XSLTPROC=xsltproc +XSLTPROC_OPTS= + +XMLLINT=xmllint +XMLLINT_OPTS= +XINCLUDE=$(XMLLINT) $(XMLLINT_OPTS) --xinclude + +CVS2CL=cvs2cl +CVS2CL_OPTS= + +SED=sed +SED_OPTS= + # stylesheet for generating HTML version of release notes DOC-LINK-STYLE=$(DOCBOOK_CVS)/xsl/docsrc/doc-link-docbook.xsl +# stylesheet used in making NEWS file(s) and releases notes +NEWS_MAKER=docsrc/release-notes.xsl + +# stylesheet used for determining the latest cvs tag in cvs log +GET_LATEST_TAG=docsrc/get-latest-tag.xsl + # stylesheet for generating FO version of release notes FO-STYLE=$(DOCBOOK_CVS)/xsl/fo/docbook.xsl -- 2.40.0