]> granicus.if.org Git - docbook-dsssl/commitdiff
Restored automated release-notes build and adjusted it to use
authorMichael Smith <xmldoc@users.sourceforge.net>
Sat, 26 Aug 2006 01:11:55 +0000 (01:11 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Sat, 26 Aug 2006 01:11:55 +0000 (01:11 +0000)
output from "svn log --xml".

releasetools/Targets.mk
releasetools/Variables.mk
releasetools/docbook-build
releasetools/svnlog2docbook.xsl [moved from releasetools/cvs2cl2docbook.xsl with 65% similarity]

index e36fa6447a564fb07c9a756907db400edfeb7e20..4be5a10e80b7ea09d5e1f35ec503a4b8f24a43a5 100644 (file)
@@ -34,12 +34,12 @@ endif
 $(MARKUP_XSL):
        $(MAKE) -C $(dir $(MARKUP_XSL))
 
-#NEWS.xml: ChangeLog.xml
-#      $(XSLT) $< $(CVS2CL2DOCBOOK) $@ \
-#      latest-tag="'$(LATEST_TAG)'" \
-#      release-version="'$(RELVER)'" \
-#      element.file="'$(shell readlink -f ./docsrc/docbook-elements.xsl)'" \
-#      param.file="'$(shell readlink -f ./docsrc/xsl-params.xsl)'"
+NEWS.xml: ChangeLog.xml
+       $(XSLT) $< $(SVNLOG2DOCBOOK) $@ \
+       previous-release="'$(PREVIOUS_RELEASE)'" \
+       release-version="'$(RELVER)'" \
+       element.file="'$(shell readlink -f ./docsrc/docbook-elements.xsl)'" \
+       param.file="'$(shell readlink -f ./docsrc/xsl-params.xsl)'"
 
 NEWS.html: NEWS.xml
        $(XSLT) $< $(DOC-LINK-STYLE) $@
@@ -47,14 +47,14 @@ NEWS.html: NEWS.xml
 $(NEWSFILE): NEWS.html
        LANG=C $(BROWSER) $(BROWSER_OPTS) $< > $@
 
-ChangeLog.xml: PreviousRelease
+ChangeLog.xml: PreviousRevision
        $(SVN) $(SVN_OPTS) log --xml --verbose \
-       -r HEAD:$(PREVIOUS_RELEASE) \
+       -r HEAD:$(PREVIOUS_REVISION) \
        | $(XMLLINT) $(XMLLINT_OPTS) --format - > $@
 
-PreviousRelease:
+PreviousRevision:
        $(SVN) $(SVN_OPTS) list --xml VERSION \
-       | $(XSLTPROC) $(GET_PREVIOUS_RELEASE) - > $@
+       | $(XSLTPROC) $(GET_PREVIOUS_REVISION) - > $@
 
 ChangeHistory.xml.zip: ChangeHistory.xml
        $(ZIP) $(ZIP_OPTS) $@ $<
@@ -82,8 +82,7 @@ catalog.xml: .make-catalog.xsl
 install.sh: $(INSTALL_SH) .CatalogManager.properties.example .urilist catalog.xml
        cp $< $@
 
-#distrib: all $(DISTRIB_DEPENDS) RELEASE-NOTES.txt RELEASE-NOTES.pdf $(NEWSFILE)
-distrib: all $(DISTRIB_DEPENDS) ChangeLog.xml
+distrib: all $(DISTRIB_DEPENDS) RELEASE-NOTES.txt RELEASE-NOTES.pdf $(NEWSFILE)
 
 #newversion:
 #ifeq ($(CVSCHECK),)
index 224b63c13388d82cd695ea52064509c7f4357b89..44cac3da2d34189ca761217d416aca5b2249f85a 100644 (file)
@@ -21,11 +21,24 @@ MARKUP_XSL=$(DOCBOOK_SVN)/contrib/tools/tennison/modified-markup.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_SVN)/releasetools/cvs2cl2docbook.xsl
+SVNLOG2DOCBOOK=$(DOCBOOK_SVN)/releasetools/svnlog2docbook.xsl
 
 # stylesheet used for determining the revision number of the
 # last/latest release
-GET_PREVIOUS_RELEASE=$(DOCBOOK_SVN)/releasetools/get-previous-release.xsl
+GET_PREVIOUS_REVISION=$(DOCBOOK_SVN)/releasetools/get-previous-revision.xsl
+
+# stylesheet used for finding the previous release number in the
+# RELEASE-NOTES.xml file.
+GET_PREVIOUS_RELEASE := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
+                xmlns:db="http://docbook.org/ns/docbook" \
+                version="1.0"> \
+  <xsl:output method="text"/> \
+  <xsl:template match="/"> \
+    <xsl:value-of select="substring-after(/db:article/db:sect1/db:title, &apos; &apos;)"/> \
+  </xsl:template> \
+</xsl:stylesheet>
+
+PREVIOUS_RELEASE=$(shell echo '$(GET_PREVIOUS_RELEASE)' | $(XSLTPROC) $(XSLTPROC_OPTS) - RELEASE-NOTES.xml)
 
 # stylesheet for stripping DB5 namespace
 STRIP_NS=$(DOCBOOK_SVN)/xsl/common/stripns.xsl
@@ -54,7 +67,7 @@ DBLATEX_FLAGS = -b pdftex
 # file containing "What's New" info generated from Subversion log
 NEWSFILE=NEWS
 
-PREVIOUS_RELEASE=$(shell if [ -f PreviousRelease ];then cat PreviousRelease; fi)
+PREVIOUS_REVISION=$(shell if [ -f PreviousRevision ];then cat PreviousRevision; fi)
 
 # determine RELVER automatically by:
 #
@@ -121,7 +134,7 @@ ZIP_EXCLUDES = \
  Makefile.common \
  Makefile.incl \
  Makefile.param \
- PreviousRelease \
+ PreviousRevision \
  README\.SVN \
  RELEASE-NOTES\.fo \
  \.make-catalog\.xsl
index ceeafee45bc38f5a54b43709703290f67d250d86..bb2751bd902c1725fcf9c62ea746f18510dfd714 100755 (executable)
@@ -206,7 +206,7 @@ else
       DIFFVER=`cat $DISTRO/VERSION`
     fi
 
-    PREVIOUS_RELEASE=`if [ -f $DISTRO/PreviousRelease ]; then cat $DISTRO/PreviousRelease; fi`
+    PREVIOUS_REVISION=`if [ -f $DISTRO/PreviousRevision ]; then cat $DISTRO/PreviousRevision; fi`
     if [ $MESSAGE_ID ]; then
       BUILD_ID=$MESSAGE_ID
     else
@@ -233,7 +233,7 @@ else
     date
     echo
     # echo selected variables
-    set | grep "BUILD_ID\|^CHANGE\|PREVIOUS_RELEASE\|DIFFVER\|^DISTRO=\|RELEASEVERSION"
+    set | grep "BUILD_ID\|^CHANGE\|PREVIOUS_REVISION\|DIFFVER\|^DISTRO=\|RELEASEVERSION"
     echo
 
     echo "Running svn update in gentext and $DISTRO working directories..."
@@ -268,8 +268,8 @@ It is intended for testing purposes only and otherwise comes with no
 guarantees. It may in fact be broken.
 EOF
 
-    if [ -n "$PREVIOUS_RELEASE" ]; then
-      svn log --verbose -r HEAD:$PREVIOUS_RELEASE $DISTRO > $DISTRO/LatestChanges
+    if [ -n "$PREVIOUS_REVISION" ]; then
+      svn log --verbose -r HEAD:$PREVIOUS_REVISION $DISTRO > $DISTRO/LatestChanges
     fi
 
     if [ "$UPLOAD" = "yes" ]; then
similarity index 65%
rename from releasetools/cvs2cl2docbook.xsl
rename to releasetools/svnlog2docbook.xsl
index a065a97f62c41eeb93531bce2a83286ce39620da..0b9c9c47017a557544e6c905d359f965cdafb8d9 100644 (file)
@@ -2,9 +2,7 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:exsl="http://exslt.org/common"
                 xmlns:sf="http://sourceforge.net/"
-                xmlns:cvs="http://www.red-bean.com/xmlns/cvs2cl/"
-               xmlns="http://docbook.org/ns/docbook"
-                exclude-result-prefixes="exsl sf cvs"
+                exclude-result-prefixes="exsl sf"
                 version='1.0'>
   <!-- ********************************************************************
        $Id$
@@ -16,7 +14,7 @@
 
        ******************************************************************** -->
 
-  <!-- * the modified-markup.xsl file is a slightly modified version -->
+  <!-- * The modified-markup.xsl file is a slightly modified version -->
   <!-- * of Jeni Tennison's "Markup Utility" stylesheet -->
   <!-- * -->
   <!-- *   http://www.jenitennison.com/xslt/utilities/markup.html -->
@@ -39,9 +37,7 @@
   <!-- ==================================================================== -->
 
   <!-- * This stylesheet converts XML-formatted ChangeLog output of the -->
-  <!-- * cvs2cl command into DocBook form. -->
-  <!-- * -->
-  <!-- *   http://www.red-bean.com/cvs2cl/ -->
+  <!-- * "svn log" command into DocBook form. -->
   <!-- * -->
   <!-- * Features :-->
   <!-- * -->
   <!-- *   XSL stylesheet param names, and marks them up with -->
   <!-- *   <parameter>hoge.moge.baz</parameter> instances -->
   <!-- * -->
-  <!-- * - discards newlines, so don't rely on them in your commit messages -->
-  <!-- * -->
-  <!-- * - converts cvs usernames to corresponding users' real names -->
+  <!-- * - converts usernames to corresponding users' real names -->
   <!-- * -->
 
   <xsl:param name="release-version"/>
-  <xsl:param name="release-version-ncname">
-    <xsl:text>V</xsl:text>
-    <xsl:value-of select="translate($release-version, '.', '')"/>
-  </xsl:param>
-  <xsl:param name="latest-tag">VXXXX</xsl:param>
-  <!-- * We get the value of $previous-release by chopping up the latest -->
-  <!-- * tag, then putting it back together. With dots. -->
-  <xsl:param name="previous-release">
-    <xsl:value-of select="
-      concat(
-      substring($latest-tag, 2, 1),
-      '.',
-      substring($latest-tag, 3, 2),
-      '.',
-      substring($latest-tag, 5, 1)
-      )"/>
-  </xsl:param>
-
-  <xsl:strip-space elements="changelog entry"/>
+  <xsl:param name="previous-release"/>
 
   <!-- * $subsections holds a "display name" for each subsection to -->
   <!-- * include in the release notes. The lowercase versions of these -->
     </sf:user>
   </sf:users>
 
-  <xsl:template match="cvs:changelog">
+  <xsl:template match="log">
     <xsl:text>&#xa;</xsl:text>
     <article>
       <xsl:text>&#xa;</xsl:text>
       <xsl:text>&#xa;</xsl:text> 
       <sect1>
         <xsl:attribute
-            name="xml:id"><xsl:value-of
-            select="$release-version-ncname"/></xsl:attribute>
+            name="xml:id">V<xsl:value-of
+            select="$release-version"/></xsl:attribute>
         <xsl:text>&#xa;</xsl:text>
         <title>Release: <xsl:value-of select="$release-version"/></title>
         <xsl:text>&#xa;</xsl:text>
     <!-- * param, popping them off until it depletes the list. -->
     <xsl:param name="subsection"/>
     <xsl:param name="remaining-subsections"/>
-      <!-- * dirname is a lowercase version of the "display name" for -->
-      <!-- * each subsection -->
+    <!-- * dirname is a lowercase version of the "display name" for -->
+    <!-- * each subsection -->
     <xsl:param name="dirname"
                select="translate($subsection,
                        'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
     <!-- * the entire list and depleted it; so that's the point at which -->
     <!-- * the template stops recursing and returns -->
     <xsl:if test="not($subsection = '')">
-      <sect2>
-        <!-- * the ID on each Sect2 is the release version plus the -->
-        <!-- * subsection name; for example, xml:id="snapshost_FO" -->
-        <xsl:attribute
-            name="xml:id"><xsl:value-of
-            select="$release-version-ncname"/>_<xsl:value-of select="$subsection"/></xsl:attribute>
-        <xsl:text>&#xa;</xsl:text>
-        <title><xsl:value-of select="$subsection"/></title>
-        <xsl:text>&#xa;</xsl:text>
-        <para>The following changes have been made to the
-        <filename><xsl:value-of select="$dirname"/></filename> code
-        since the <xsl:value-of select="$previous-release"/> release.</para>
-        <xsl:text>&#xa;</xsl:text>
-        <!-- * We put the commit descriptions into an Itemizedlist, one -->
-        <!-- * Item for each commit -->
-        <itemizedlist>
+      <!-- * Output a sect2 for this subsection only if with find path names -->
+      <!-- * for changed files in this subsection -->
+      <xsl:if test="logentry[paths/path[starts-with(.,concat('/trunk/xsl/',$dirname,'/'))]]">
+        <sect2>
+          <!-- * the ID on each Sect2 is the release version plus the -->
+          <!-- * subsection name; for example, xml:id="snapshost_FO" -->
+          <xsl:attribute
+            name="xml:id">V<xsl:value-of
+              select="$release-version"/>_<xsl:value-of select="$subsection"/></xsl:attribute>
+          <xsl:text>&#xa;</xsl:text>
+          <title><xsl:value-of select="$subsection"/></title>
+          <xsl:text>&#xa;</xsl:text>
+          <para>The following changes have been made to the
+            <filename><xsl:value-of select="$dirname"/></filename> code
+            since the <xsl:value-of select="$previous-release"/> release.</para>
+          <xsl:text>&#xa;</xsl:text>
+          <!-- * We put the commit descriptions into an Itemizedlist, one -->
+          <!-- * Item for each commit -->
+          <itemizedlist>
+            <xsl:text>&#xa;</xsl:text>
+            <xsl:call-template name="format.entries">
+              <xsl:with-param name="dirname" select="$dirname"/>
+            </xsl:call-template>
+          </itemizedlist>
           <xsl:text>&#xa;</xsl:text>
-          <xsl:call-template name="format.entries">
-            <xsl:with-param name="dirname" select="$dirname"/>
-          </xsl:call-template>
-        </itemizedlist>
+        </sect2>
+        <!-- * for example, "end of FO changes for V1691" -->
+        <xsl:comment>end of <xsl:value-of
+        select="$subsection"/> changes for <xsl:value-of
+        select="$release-version"/></xsl:comment>
         <xsl:text>&#xa;</xsl:text>
-      </sect2>
-      <!-- * for example, "end of FO changes for V1691" -->
-      <xsl:comment>end of <xsl:value-of
-      select="$subsection"/> changes for <xsl:value-of
-      select="$release-version"/></xsl:comment>
-      <xsl:text>&#xa;</xsl:text>
-      <xsl:text>&#xa;</xsl:text>
+        <xsl:text>&#xa;</xsl:text>
+      </xsl:if>
       <xsl:call-template name="format.subsection">
         <!-- * pop the name of the next subsection off the list of -->
         <!-- * remaining subsections -->
 
   <xsl:template name="format.entries">
     <xsl:param name="dirname"/>
-    <xsl:for-each select="cvs:entry[cvs:file/cvs:name[starts-with(.,concat($dirname,'/'))]]">
+    <xsl:for-each
+        select="logentry[paths/path[starts-with(.,concat('/trunk/xsl/',$dirname,'/'))]]">
       <!-- * each Lisitem corresponds to a single commit -->
-      <listitem role="commit-message">
+      <listitem>
         <xsl:text>&#xa;</xsl:text>
         <!-- * for each entry (commit), get the commit message. Also -->
         <!-- * get the filename(s) + revision(s) and username, and -->
-        <!-- * put it on the end -->
-       <xsl:call-template name="format-message">
-         <xsl:with-param name="text" select="string(cvs:msg)"/>
-       </xsl:call-template>
-       <para role="commit-changes">
-         <xsl:text>Modified: </xsl:text>
-         <xsl:for-each select="cvs:file">
-           <xsl:apply-templates select="."/>
-           <xsl:if test="not(position() = last())">
-             <xsl:text>; </xsl:text>
-           </xsl:if>
-         </xsl:for-each>
-         <xsl:text> - </xsl:text>
-         <xsl:apply-templates select="cvs:author"/>
-        </para>
+        <!-- * put it into an Alt element, which will become a Title -->
+        <!-- * element in HTML output, generating "tooltip text"-->
+        <literallayout format="linespecific"
+          ><phrase role="commit-message">
+            <xsl:apply-templates select="msg"/>
+            <alt>
+              <!-- * Only get path names for files that are in the subsection -->
+              <!-- * that we are currently formatting -->
+              <xsl:for-each select="paths/path[starts-with(.,concat('/trunk/xsl/',$dirname,'/'))]">
+                <xsl:apply-templates select="."/>
+                <xsl:if test="not(position() = last())">
+                  <xsl:text>; </xsl:text>
+                </xsl:if>
+              </xsl:for-each>
+              <xsl:text> - </xsl:text>
+              <xsl:apply-templates select="author"/>
+            </alt>
+          </phrase></literallayout>
         <xsl:text>&#xa;</xsl:text>
       </listitem>
       <xsl:text>&#xa;</xsl:text>
     </xsl:for-each>
   </xsl:template>
 
-  <xsl:template name="format-message">
-    <xsl:param name="text" select="''"/>
-    <xsl:choose>
-      <xsl:when test="contains($text,'&#xa;&#xa;')">
-       <para>
-         <xsl:call-template name="add-markup">
-           <xsl:with-param name="text"
-                           select="substring-before($text,'&#xa;&#xa;')"/>
-         </xsl:call-template>
-       </para>
-       <xsl:call-template name="format-message">
-         <xsl:with-param name="text"
-                         select="substring-after($text,'&#xa;&#xa;')"/>
-       </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-       <para>
-         <xsl:call-template name="add-markup">
-           <xsl:with-param name="text" select="$text"/>
-         </xsl:call-template>
-       </para>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-
-  <xsl:template name="add-markup">
-    <xsl:param name="text" select="''"/>
-
+  <xsl:template match="msg">
     <!-- * trim off any leading and trailing whitespace from this -->
     <!-- * commit message -->
     <xsl:variable name="trimmed">
       <xsl:call-template name="trim.text">
-        <xsl:with-param name="contents" select="$text"/>
+        <xsl:with-param name="contents" select="."/>
       </xsl:call-template>
     </xsl:variable>
     <xsl:variable name="trimmed-contents" select="exsl:node-set($trimmed)"/>
             name="phrases"
             select="document($element.file)//member|
                     document($param.file)//member"
-            />
+          />
       </xsl:call-template>
     </xsl:variable>
     <xsl:variable name="marked.up" select="exsl:node-set($marked.up.contents)"/>
     <!-- * return the marked-up contents, unmasked -->
-      <xsl:apply-templates select="$marked.up" mode="restore.period"/>
+    <xsl:apply-templates select="$marked.up" mode="restore.period"/>
   </xsl:template>
 
   <!-- * template for matching DocBook element names -->
     <xsl:param
         name="lowercased-word"
         select="translate($word,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
-       <!-- * adjust the value of $stopwords by removing all whitepace -->
-       <!-- * from it and adding a comma to the beginning and end of it -->
+    <!-- * adjust the value of $stopwords by removing all whitepace -->
+    <!-- * from it and adding a comma to the beginning and end of it -->
     <xsl:param
         name="adjusted-stopwords"
         select="concat(',',translate($stopwords,'&#9;&#10;&#13;&#32;',''),',')"/>
     <parameter><xsl:value-of select="$word" /></parameter>
   </xsl:template>
 
-  <xsl:template match="cvs:file">
-    <xsl:value-of
-    select="cvs:name"/><xsl:text>,</xsl:text><xsl:value-of
-    select="cvs:revision"/>
+  <xsl:template match="path">
+    <xsl:value-of select="@action"/>: <xsl:value-of select="."/>
   </xsl:template>
 
-  <xsl:template match="cvs:author">
+  <xsl:template match="author">
     <xsl:variable name="username" select="."/>
     <!-- * based on Sourceforge cvs username, get a real name and use -->
     <!-- * that in the result document, instead of the username -->
-      <xsl:value-of
+    <xsl:value-of
       select="document('')//sf:users/sf:user[sf:username = $username]/sf:firstname"/>
-      <xsl:text> </xsl:text>
-      <xsl:value-of
+    <xsl:text> </xsl:text>
+    <xsl:value-of
       select="document('')//sf:users/sf:user[sf:username = $username]/sf:surname"/>
   </xsl:template>
 
           <xsl:with-param name="target">. </xsl:with-param>
           <xsl:with-param name="replacement">;&#x2302; </xsl:with-param>
           <xsl:with-param name="string">
-              <xsl:choose>
-                <xsl:when test="substring(., string-length(.)) = '.'">
-                  <xsl:value-of
-                      select="concat(substring(.,1,string-length(.) - 1),';&#x2302;')"/>
-                </xsl:when>
-                <xsl:otherwise>
-                  <xsl:copy-of select="."/>
-                </xsl:otherwise>
+            <xsl:choose>
+              <xsl:when test="substring(., string-length(.)) = '.'">
+                <xsl:value-of
+                  select="concat(substring(.,1,string-length(.) - 1),';&#x2302;')"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:copy-of select="."/>
+              </xsl:otherwise>
             </xsl:choose>
           </xsl:with-param>
         </xsl:call-template>
   <!-- * unwind results of mask.period - and, as a bonus, convert all -->
   <!-- * newlines characters to instances of a"linebreak element" -->
   <xsl:template match="text()" mode="restore.period">
-    <xsl:call-template name="newlines.to.linebreak.element">
-      <xsl:with-param name="string">
-        <xsl:call-template name="string.subst">
-          <xsl:with-param name="string" select="."/>
-          <xsl:with-param name="target">;&#x2302;</xsl:with-param>
-          <xsl:with-param name="replacement">.</xsl:with-param>
-        </xsl:call-template>
-      </xsl:with-param>
+    <xsl:call-template name="string.subst">
+      <xsl:with-param name="string" select="."/>
+      <xsl:with-param name="target">;&#x2302;</xsl:with-param>
+      <xsl:with-param name="replacement">.</xsl:with-param>
     </xsl:call-template>
+
   </xsl:template>
 
   <xsl:template match="*" mode="restore.period">
     <xsl:copy-of select="."/>
   </xsl:template>
 
-  <!-- * ============================================================== -->
-  <!-- *    Utility template for preserving linebreaks in output        -->
-  <!-- * ============================================================== -->
-  <xsl:template name="newlines.to.linebreak.element">
-    <xsl:param name="string"/>
-    <xsl:param name="linebreak.element"><sbr /></xsl:param>
-    <xsl:choose>
-      <xsl:when test="contains($string, '&#xA;')">
-        <xsl:value-of select="substring-before($string, '&#xA;')" />
-        <xsl:copy-of select="$linebreak.element" />
-        <xsl:call-template name="newlines.to.linebreak.element">
-          <xsl:with-param name="string"
-                          select="substring-after($string, '&#xA;')" />
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="$string" />
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-
 </xsl:stylesheet>
-