]> granicus.if.org Git - docbook-dsssl/commitdiff
- Added the "tag" make target (unfinished) for tagging releases.
authorMichael Smith <xmldoc@users.sourceforge.net>
Fri, 27 Jul 2007 07:00:22 +0000 (07:00 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Fri, 27 Jul 2007 07:00:22 +0000 (07:00 +0000)
- Renamed get-element.xsl to eval-xpath.xsl and modified it to be
  capable of getting string value of a node based on an XPath
  expression provided on the command line.
- Removed get-param.xsl as changes to the xsl/VERSION file make
  get-params.xsl obsolete.

releasetools/Targets.mk
releasetools/Variables.mk
releasetools/eval-xpath.xsl [new file with mode: 0644]
releasetools/get-element.xsl [deleted file]
releasetools/get-param.xsl [deleted file]
xsl/VERSION

index 83edd53dc5094c6dc0cbb1c48c720231a4195863..3f89748bc2aeac517d27f5b8ea9d3c7b4081e90c 100644 (file)
@@ -107,7 +107,7 @@ else
 distrib: all $(DISTRIB_DEPENDS) $(NEWSFILE)
 endif
 
-release: distrib $(RELEASE_DEPENDS)
+release: distrib $(RELEASE_DEPENDS) tag
 
 #newversion:
 #ifeq ($(CVSCHECK),)
@@ -147,7 +147,7 @@ else
 endif
 
 ifeq ($(OFFLINE),yes)
-zip:
+zip: tag
 else
 zip: ChangeHistory.xml.zip
 endif
@@ -262,6 +262,17 @@ install: upload-to-sf-incoming upload-to-project-webspace
 announce: RELEASE-NOTES-PARTIAL.txt
        $(RELEASE_ANNOUNCE) $(RELVER) $(ANNOUNCE_RECIPIENTS)
 
+tag:
+       if [ -z "$(svn status)" ]; \
+         then echo "$(SVN) $(SVN_OPTS) delete $(REPOSITORY_ROOT)/tags/$(TAG)/$(DISTRO)"; \
+         echo "$(SVN) $(SVN_OPTS) copy -r $(REVISION) $(DISTRO_URL) $(REPOSITORY_ROOT)/tags/$(TAG)/$(DISTRO)"; \
+         else \
+         echo "Unversioned or uncommitted files found. Before making the"; \
+         echo "zip target, either delete the following files, add them to"; \
+         echo "the repository, or add them to the svn:ignore properties for"; \
+         echo "their parent directories."; \
+         fi
+
 release-clean: clean
        $(MAKE) -C docsrc release-clean
        $(RM) TERMS.xml
index f1d5648ad56266bc5a332d8d7cea442c854727d5..5799ca313165937443e5f817419f0754630e389d 100644 (file)
@@ -69,10 +69,11 @@ SVNLOG2DOCBOOK=$(DOCBOOK_SVN)/releasetools/svnlog2docbook.xsl
 
 SVN_INFO_FILE=.svninfo.xml
 
-PREVIOUS_RELEASE=$(shell $(XSLTPROC) --stringparam param 'PreviousRelease' $(GETPARAM) VERSION)
+PREVIOUS_RELEASE=$(shell $(XSLTPROC) --stringparam get PreviousRelease VERSION VERSION)
 
-REPOSITORY_ROOT=$(shell $(XSLTPROC) --stringparam element root $(GETELEMENT) $(SVN_INFO_FILE))
-DISTRO_URL=$(shell $(XSLTPROC) --stringparam element url $(GETELEMENT) $(SVN_INFO_FILE))
+REPOSITORY_ROOT=$(shell $(XSLTPROC) --stringparam expression //root $(EVALXPATH) $(SVN_INFO_FILE))
+DISTRO_URL=$(shell $(XSLTPROC) --stringparam expression //url $(EVALXPATH) $(SVN_INFO_FILE))
+REVISION=$(shell $(XSLTPROC) --stringparam expression //commit@revision $(EVALXPATH) $(SVN_INFO_FILE))
 DISTRO_PARENT_URL=$(dir $(basename $(DISTRO_URL)))
 
 # stylesheet for stripping DB5 namespace
@@ -99,7 +100,9 @@ DBLATEX_FLAGS = -b pdftex
 # file containing "What's New" info generated from Subversion log
 NEWSFILE=NEWS
 
-PREVIOUS_REVISION=$(shell $(XSLTPROC) --stringparam param 'PreviousReleaseRevision' $(GETPARAM) VERSION)
+PREVIOUS_REVISION=$(shell $(XSLTPROC) --stringparam get PreviousReleaseRevision VERSION VERSION)
+
+TAG=$(shell $(XSLTPROC) --stringparam get Tag VERSION VERSION)
 
 # determine RELVER automatically by:
 #
@@ -202,8 +205,7 @@ GZIPFLAGS=
 XSLTPROC=xsltproc
 XSLTPROC_OPTS=
 
-GETPARAM=$(DOCBOOK_SVN)/releasetools/get-param.xsl
-GETELEMENT=$(DOCBOOK_SVN)/releasetools/get-element.xsl
+EVALXPATH=$(DOCBOOK_SVN)/releasetools/eval-xpath.xsl
 
 XMLLINT=xmllint
 XMLLINT_OPTS=--noent
diff --git a/releasetools/eval-xpath.xsl b/releasetools/eval-xpath.xsl
new file mode 100644 (file)
index 0000000..97098a9
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:sf="http://sourceforge.net/"
+  xmlns:dyn="http://exslt.org/dynamic"
+  version='1.0'>
+  <!-- ********************************************************************
+       $Id$
+       ******************************************************************** -->
+
+  <xsl:output method="text"/>
+  <xsl:param name="expression"/>
+
+  <xsl:template match="/">
+    <xsl:choose>
+      <!-- * xsltproc and Xalan both support dyn:evaluate() -->
+      <xsl:when test="function-available('dyn:evaluate')">
+        <xsl:value-of select="dyn:evaluate($expression)"/>
+      </xsl:when>
+      <!-- * Saxon has its own evaluate() & doesn't support dyn:evaluate() -->
+      <xsl:when test="function-available('saxon:evaluate')">
+        <xsl:value-of select="saxon:evaluate($expression)"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/releasetools/get-element.xsl b/releasetools/get-element.xsl
deleted file mode 100644 (file)
index b87d5fd..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version='1.0'>
-  <!-- ********************************************************************
-       $Id$
-       ******************************************************************** -->
-
-  <xsl:output method="text"/>
-  <xsl:param name="element"/>
-
-  <xsl:template match="/">
-    <xsl:value-of select="//*[local-name() = $element]"/>
-  </xsl:template>
-
-</xsl:stylesheet>
diff --git a/releasetools/get-param.xsl b/releasetools/get-param.xsl
deleted file mode 100644 (file)
index ab96eec..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                version='1.0'>
-  <!-- ********************************************************************
-       $Id$
-       ******************************************************************** -->
-  
-  <xsl:output method="text"/>
-  <xsl:param name="param"/>
-  
-  <xsl:template match="/">
-    <xsl:param name="target" select="//*[@*[local-name() = 'name'] = $param]"/>
-    <xsl:choose>
-      <!-- * if param contains ': ', it's an RCS keyword like -->
-      <!-- * '$Revision$', we want to get the part after the -->
-      <!-- * opening ': ' and before the closing ' $' delimiters -->
-      <xsl:when test="contains($target, ': ')">
-        <xsl:value-of select="substring-before(substring-after($target, ': '), ' $')"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="$target"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-</xsl:stylesheet>
index ecb8abeb1ce4c878b0072307eb43a84917dd3c63..19530b1bd48d0de36f180a69fd203c28e0d4f776 100644 (file)
@@ -2,10 +2,16 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
   xmlns:sf="http://sourceforge.net/"
+  xmlns:dyn="http://exslt.org/dynamic"
+  xmlns:saxon="http://icl.com/saxon"
   exclude-result-prefixes="fm sf"
   version='1.0'>
 
+<xsl:output omit-xml-declaration="yes"/>
+
+<xsl:param name="get"/>
 <xsl:param name="VERSION" select="string(document('')//fm:Version[1])"/>
+<xsl:param name="Tag" select="concat('V',translate(string(document('')//fm:Version[1]),'.',''))"/>
 <xsl:param name="DistroTitle" select="string(document('')//fm:Branch[1])"/>
 <xsl:param name="DistroName">docbook-xsl</xsl:param>
 <xsl:param name="PreviousRelease">1.72.0</xsl:param>
@@ -45,13 +51,25 @@ Major feature enhancements
 </fm:project>
 
 <xsl:template match="/" priority="-100">
-  <xsl:if test="$sf-relid = 0">
-    <xsl:message terminate="yes">
-      <xsl:text>You must specify the sf-relid as a parameter.</xsl:text>
-    </xsl:message>
-  </xsl:if>
-
-  <xsl:apply-templates select="//fm:project"/>
+  <xsl:choose>
+    <xsl:when test="$get = 'Tag'">
+      <xsl:value-of select="$Tag"/>
+    </xsl:when>
+    <xsl:when test="$get = 'PreviousRelease'">
+      <xsl:value-of select="$PreviousRelease"/>
+    </xsl:when>
+    <xsl:when test="$get = 'PreviousReleaseRevision'">
+      <xsl:value-of select="$PreviousReleaseRevision"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="$sf-relid = 0">
+        <xsl:message terminate="yes">
+         <xsl:text>You must specify the sf-relid as a parameter.</xsl:text>
+        </xsl:message>
+      </xsl:if>
+      <xsl:apply-templates select="//fm:project"/>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="fm:project">