diff options
author | Paul W. Frields <stickster@gmail.com> | 2006-01-15 17:05:14 +0000 |
---|---|---|
committer | Paul W. Frields <stickster@gmail.com> | 2006-01-15 17:05:14 +0000 |
commit | e88daf0d5bf3f51a5d141b2d774fe82908992dda (patch) | |
tree | 1915b39a4d1df3bf33ac5ae1d17b38a9c87d7084 /packaging/insert-changelog.xsl | |
parent | b1d82b32861b139655db1cf30146c1aeaed1c92b (diff) | |
download | fedora-doc-utils-e88daf0d5bf3f51a5d141b2d774fe82908992dda.tar.gz fedora-doc-utils-e88daf0d5bf3f51a5d141b2d774fe82908992dda.tar.xz fedora-doc-utils-e88daf0d5bf3f51a5d141b2d774fe82908992dda.zip |
These snippets will be useful in Makefile.common, since they enable:
1. inserting new worker and revision elements (both newest-first of course!)
2. querying the document for a tight listing of the entire colophon, so the user can choose who is responsible for a new revision
3. querying the document for a specific worker attribute
The "make worker" target idea is simple enough, but more importantly, the use case for a "make clog" target would be:
1. User picks whether revision role is "rpm" or "doc", today's date is formatted properly for the role
2. User picks their name from the tight colophon listing
3. The make target automatically queries for the worker attribute appropriate for that revision role (e.g. initials for doc, email for rpm)
Diffstat (limited to 'packaging/insert-changelog.xsl')
-rw-r--r-- | packaging/insert-changelog.xsl | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/packaging/insert-changelog.xsl b/packaging/insert-changelog.xsl new file mode 100644 index 0000000..2391f1f --- /dev/null +++ b/packaging/insert-changelog.xsl @@ -0,0 +1,65 @@ +<!-- + +Add a RPM changelog entry to a document's rpm-info.xml file. +The following stringparam values are expected in this file: + detail : Text describing the change + date : Date of change, formatted properly: + For role="rpm", date format is +"%a %b %d %Y" + For role="doc", date format is +"%Y-%m-%d" + number : Number for change, formatted properly: + For role="rpm", integer release number + For role="doc", version number for document + person : ID for responsible entity, drawn from current <colophon> + role : "doc" or "rpm", indicating type of change + +--> + +<xsl:stylesheet version="1.0" xml:space="preserve" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:output encoding="UTF-8" indent="yes" method="xml" omit-xml-declaration="yes" standalone="no" version="1.0"/> + + <xsl:template match="/"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="rpm-info"> + <xsl:element name="rpm-info"> + <xsl:for-each select="*"> + <xsl:choose> + <xsl:when test="self::changelog"><xsl:call-template name="clog"/></xsl:when> + <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:element> + </xsl:template> + + <xsl:template name="clog"> + <xsl:element name="changelog" use-attribute-sets="clog"> + <xsl:element name="revision" use-attribute-sets="rev"> + <xsl:element name="author" use-attribute-sets="auth"/> + <xsl:comment>PLEASE SET "lang" ATTRIBUTE IN DETAILS WHERE NEEDED</xsl:comment> + <xsl:element name="details"><xsl:value-of + select="$detail"/></xsl:element> + </xsl:element> + <xsl:copy-of select="*"/> + </xsl:element> + </xsl:template> + + + <xsl:attribute-set name="clog"> + <xsl:attribute name="order">newest-first</xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="rev"> + <xsl:attribute name="date"><xsl:value-of select="$date"/></xsl:attribute> + <xsl:attribute name="number"><xsl:value-of + select="$number"/></xsl:attribute> + <xsl:attribute name="role"><xsl:value-of select="$role"/></xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="auth"> + <xsl:attribute name="worker"><xsl:value-of + select="$person"/></xsl:attribute> + </xsl:attribute-set> + +</xsl:stylesheet> |