From: <ap...@vh...> - 2005-09-22 19:29:26
|
Author: apevec Date: 2005-09-22 21:19:56 +0200 (Thu, 22 Sep 2005) New Revision: 914 Added: users/public/set-version.sh Log: modified Matt's bump-version.sh to set the same version for all apps Added: users/public/set-version.sh =================================================================== --- users/public/set-version.sh 2005-09-22 19:01:07 UTC (rev 913) +++ users/public/set-version.sh 2005-09-22 19:19:56 UTC (rev 914) @@ -0,0 +1,72 @@ +#!/bin/sh + +# set all apps to the same version + +VERSION=$1 + +for application in `find -maxdepth 3 -name application.xml`; do + cat <<XSL | xsltproc - $application | awk ' +/<ccm:application/ {print gensub("\" ", "\"\n ", "g")} +! /<ccm:application/ {print $0} +' > application.xml.new +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:str="http://exslt.org/strings" + xmlns:ccm="http://ccm.redhat.com/ccm-project" + version="1.0"> + + <xsl:output method="xml" indent="yes"/> + + <xsl:template match="ccm:application"> + <xsl:copy> + <xsl:for-each select="attribute::*"> + <xsl:choose> + <xsl:when test="name() = 'version'"> + <xsl:attribute name="version">$VERSION</xsl:attribute> + </xsl:when> + + <xsl:when test="name() = 'release'"> + <xsl:attribute name="release">1</xsl:attribute> + </xsl:when> + + <xsl:otherwise> + <xsl:copy/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + + <xsl:apply-templates mode="copy"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="*" mode="copy"> + <xsl:copy> + <xsl:for-each select="attribute::*"> + <xsl:copy/> + </xsl:for-each> + <xsl:apply-templates mode="copy"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="ccm:requires" mode="copy"> + <xsl:copy> + <xsl:for-each select="attribute::*"> + <xsl:choose> + <xsl:when test="name()='version'"> + <xsl:attribute name="version">$VERSION</xsl:attribute> + </xsl:when> + + <xsl:otherwise> + <xsl:copy/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:copy> + </xsl:template> + +</xsl:stylesheet> +XSL + + mv application.xml.new $application +done + Property changes on: users/public/set-version.sh ___________________________________________________________________ Name: svn:executable + * |