From b39d172d5600f8621661f9a5bec6135a8703e46b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 27 Mar 2006 04:48:09 +0000 Subject: [PATCH] Added cvs2cl2docbook.xsl stylesheet for converting XML-formatted ChangeLog output of the cvs2cl command into DocBook form. It uses Jeni Tennison's "Markup Utility" stylesheet to auto-mark-up instances of DocBook element and parameter names in commit messages. It also preserves newlines in the messages. Removed older version of this stylesheet from xsl/ --- releasetools/Targets.mk | 43 +++-- releasetools/Variables.mk | 42 +++-- .../cvs2cl2docbook.xsl | 155 +++++++++++++++++- .../get-latest-tag.xsl | 7 +- releasetools/get-terms.xsl | 135 +++++++++++++++ 5 files changed, 337 insertions(+), 45 deletions(-) rename xsl/docsrc/release-notes.xsl => releasetools/cvs2cl2docbook.xsl (56%) rename xsl/docsrc/get-element-names.xsl => releasetools/get-latest-tag.xsl (81%) create mode 100644 releasetools/get-terms.xsl diff --git a/releasetools/Targets.mk b/releasetools/Targets.mk index d2c9c282a..88eea828d 100644 --- a/releasetools/Targets.mk +++ b/releasetools/Targets.mk @@ -26,15 +26,11 @@ endif 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)'" - for element in \ - $(shell $(XSLT) $(DOCBOOK_RNG) $(GET_ELEMENT_NAMES) | sort | uniq); \ - do $(SED) $(SED_OPTS) -i \ - "s/\([^<\/A-Za-z0-9_\.\-]\)\($$element\)\([^A-Za-z0-9_\.\-]\)/\1\2<\/FOOM>\3/g" $@; done; \ - $(SED) $(SED_OPTS) -i s/FOOM/tag/g $@ +NEWS.xml: ChangesSince$(LATEST_TAG).xml TERMS.xml + $(XSLT) $< $(CVS2CL2DOCBOOK) $@ \ + latest-tag="'$(LATEST_TAG)'" \ + release-version="'$(RELVER)'" \ + terms.file="'$(shell readlink -f TERMS.xml)'" NEWS.html: NEWS.xml $(XSLT) $< $(DOC-LINK-STYLE) $@ @@ -42,9 +38,9 @@ NEWS.html: NEWS.xml $(NEWSFILE): NEWS.html LANG=C $(BROWSER) $(BROWSER_OPTS) $< > $@ -ChangeLog.xml: LatestTag +ChangesSince$(LATEST_TAG).xml: LatestTag $(CVS2CL) $(CVS2CL_OPTS) \ - --delta $(shell cat LatestTag):HEAD --xml -f $@ -g -q + --delta $(LATEST_TAG):HEAD --xml -f $@ -g -q LatestTag: # Note that one of the old commit messsage in the cvs log contains @@ -54,6 +50,21 @@ LatestTag: | $(SED) $(SED_OPTS) 's/\x1a//g' \ | $(XSLTPROC) $(GET_LATEST_TAG) - > $@ +ChangeLog.xml.zip: ChangeLog.xml + $(ZIP) $(ZIP_OPTS) $@ $< + $(RM) $< + +# ChangeLog.xml holds the whole change history for the module, +# including all subdirectories +ChangeLog.xml: + $(CVS2CL) $(CVS2CL_OPTS) \ + --xml -f $@ -g -q + +TERMS.xml: $(GET_TERMS) $(DISTRIB_PARAMS_FILES) $(DOCBOOK_RNG_FILES) + $(XSLT) $< $< $@ \ + element.files="'$(DOCBOOK_RNG_FILES)'" \ + param.files="'$(DISTRIB_PARAMS_FILES)'" + .CatalogManager.properties.example: cp -p $(CATALOGMANAGER) .CatalogManager.properties.example @@ -71,7 +82,7 @@ catalog.xml: .make-catalog.xsl install.sh: .CatalogManager.properties.example .urilist catalog.xml cp $(INSTALL_SH) install.sh -distrib: all $(DISTRIB_DEPENDS) RELEASE-NOTES.txt RELEASE-NOTES.pdf $(NEWSFILE) +distrib: all $(DISTRIB_DEPENDS) ChangeLog.xml.zip RELEASE-NOTES.txt RELEASE-NOTES.pdf $(NEWSFILE) newversion: ifeq ($(CVSCHECK),) @@ -157,7 +168,7 @@ endif $(TAR) cf$(TARFLAGS) - -X $(TMP)/tar.exclude * .[^.]* | (cd $(TMP)/docbook-$(DISTRO)-$(ZIPVER); $(TAR) xf$(TARFLAGS) -) 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) + umask 022; cd $(TMP) && $(ZIP) $(ZIPFLAGS) docbook-$(DISTRO)-$(ZIPVER).zip docbook-$(DISTRO)-$(ZIPVER) $(RM) $(TMP)/tar.exclude # ----------------------------------------------------------------- @@ -187,7 +198,7 @@ ifneq ($(DISTRIB_PACKAGES),) fi) ; \ 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)); \ + umask 022; (cd $(TMP) && $(ZIP) $(ZIPFLAGS) docbook-$(DISTRO)-$$part-$(ZIPVER).zip docbook-$(DISTRO)-$(ZIPVER)); \ $(RM) $(TMP)/tar.exclude; \ done endif @@ -214,11 +225,13 @@ install: zip )" release-clean: clean + $(RM) TERMS.xml $(RM) $(NEWSFILE) $(RM) NEWS.html $(RM) NEWS.xml $(RM) RELEASE-NOTES-$(TAGVER).xml - $(RM) ChangeLog.xml + $(RM) ChangeLog.xml.zip + $(RM) ChangesSince$(LATEST_TAG).xml $(RM) LatestTag $(RM) RELEASE-NOTES.txt $(RM) RELEASE-NOTES.html diff --git a/releasetools/Variables.mk b/releasetools/Variables.mk index e134c91e1..1fff6ef65 100644 --- a/releasetools/Variables.mk +++ b/releasetools/Variables.mk @@ -12,31 +12,19 @@ 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 in taking XML output from the cvs2cl(1) perl +# script, and using it to generate NEWS file(s) and releases notes +CVS2CL2DOCBOOK=$(DOCBOOK_CVS)/releasetools/cvs2cl2docbook.xsl # stylesheet used for determining the latest cvs tag in cvs log -GET_LATEST_TAG=docsrc/get-latest-tag.xsl +GET_LATEST_TAG=$(DOCBOOK_CVS)/releasetools/get-latest-tag.xsl -GET_ELEMENT_NAMES=docsrc/get-element-names.xsl +GET_TERMS=$(DOCBOOK_CVS)/releasetools/get-terms.xsl -DOCBOOK_RNG=../docbook/relaxng/docbook/docbook.rng +DOCBOOK_RNG_FILES=$(DOCBOOK_CVS)/docbook/relaxng/docbook/docbook.rng # stylesheet for generating FO version of release notes FO-STYLE=$(DOCBOOK_CVS)/xsl/fo/docbook.xsl @@ -55,6 +43,8 @@ FO_ENGINE_OPTS= # file containing "What's New" info generated from CVS log NEWSFILE=NEWS +LATEST_TAG=$(shell if [ -f LatestTag ];then cat LatestTag; fi) + # determine RELVER automatically by: # # - figuring out if VERSION file exists @@ -147,3 +137,19 @@ RELEASE_DIR=/home/groups/d/do/docbook/htdocs/release PROJECT_USER:=`sed 's/^:.\+:\([^@]\+\)@.\+$$/\1/' CVS/Root` TAR=tar TARFLAGS=P +ZIP=zip +ZIPFLAGS=-q -rpD + +XSLTPROC=xsltproc +XSLTPROC_OPTS= + +XMLLINT=xmllint +XMLLINT_OPTS= +XINCLUDE=$(XMLLINT) $(XMLLINT_OPTS) --xinclude + +CVS2CL=cvs2cl +CVS2CL_OPTS= + +SED=sed +SED_OPTS= + diff --git a/xsl/docsrc/release-notes.xsl b/releasetools/cvs2cl2docbook.xsl similarity index 56% rename from xsl/docsrc/release-notes.xsl rename to releasetools/cvs2cl2docbook.xsl index 0d10fa686..93d052a7b 100644 --- a/xsl/docsrc/release-notes.xsl +++ b/releasetools/cvs2cl2docbook.xsl @@ -1,8 +1,9 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -183,7 +217,7 @@ - + @@ -198,7 +232,32 @@ - + + + + + + + + + + + + + + + + + + + + + + @@ -208,6 +267,90 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + . + ;⌂ + + + . + ;⌂ + + + + + + + + + + + + + + + + + + + + + + + ;⌂ + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsl/docsrc/get-element-names.xsl b/releasetools/get-latest-tag.xsl similarity index 81% rename from xsl/docsrc/get-element-names.xsl rename to releasetools/get-latest-tag.xsl index 7e2056c9b..e0ec25004 100644 --- a/xsl/docsrc/get-element-names.xsl +++ b/releasetools/get-latest-tag.xsl @@ -11,18 +11,13 @@ ******************************************************************** --> - - - - - - + diff --git a/releasetools/get-terms.xsl b/releasetools/get-terms.xsl new file mode 100644 index 000000000..61fe5f188 --- /dev/null +++ b/releasetools/get-terms.xsl @@ -0,0 +1,135 @@ + + + + + + + + + + + terms + + + + + + + + + + + + + + + + + + + + + param + + + + + + + + + + + + + + + + element + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + param + + + + + + + + + + + + + + + + + + + + -- 2.40.0