I've been having problems with patching this. I think that the resulting
code should be...
<xsl:template match="initdir">
<xsl:variable name="dir" select="translate(@dir,'\','/')"/>
<xsl:variable name="basedon" select="@basedon"/>
<xsl:if test="not(preceding::initdir[@basedon=$basedon])">
<xsl:text># first project with this code base </xsl:text>
<xsl:if test="/build/@build-sequence = 'progressive'">
<xsl:text>test -d </xsl:text>
<xsl:value-of select="$dir"/>
<xsl:text> && rm -rf </xsl:text>
<xsl:value-of select="$dir"/>
<xsl:text> </xsl:text>
</xsl:if>
</xsl:if>
<xsl:text>test -d </xsl:text>
<xsl:value-of select="$dir"/>
<xsl:text> || cp -r </xsl:text>
<xsl:value-of select="translate(@basedon,'\','/')"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$dir"/>
<xsl:text> </xsl:text>
</xsl:template>
in bash.xsl (the comment is for ease of searching the result). The problem
is, when I run this against the full buildsite.xml every project gets
reported as the first. I ran buildsite through tidy (-i -wrap 1000 -xml)
and got the same result, however after (seriously) trimming down the number
of projects the code works. I've attached the appropriate bash.xsl,
buildsite.xml and small-buildsite.xml. The instructions to test are:
$ java org.apache.xalan.xslt.Process -EDUMP -text -in work/buildsite.xml
-xsl stylesheet/bash.xsl -out work/build.sh -PARAM cmd-prefix "$CP" -PARAM
os-type "$OSTYPE"
$ java org.apache.xalan.xslt.Process -EDUMP -text -in
work/small-buildsite.xml -xsl stylesheet/bash.xsl -out work/build.sh -PARAM
cmd-prefix "$CP" -PARAM os-type "$OSTYPE"
If jakarta-ant reports as being the 'first project with this code base' it's
lying.
Help? ;-)
Thanks,
J.
=======================================================================
Information in this email and any attachments are confidential, and may
not be copied or used by anyone other than the addressee, nor disclosed
to any third party without our permission. There is no intention to
create any legally binding contract or other commitment through the use
of this email.
Experian Limited (registration number 653331).
Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF
first.zip
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]