changes.xslt (794:afd6fc00e8f2) changes.xslt (1734:3b4f1cc3117f)
1<?xml version="1.0" encoding="utf-8"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4<xsl:output method="text"/>
5
6<xsl:param select="'generic'" name="format"/>
7<xsl:param select="'unit'" name="pkgname"/>
8<xsl:param select="'change_log_conf.xml'" name="configuration"/>
1<?xml version="1.0" encoding="utf-8"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4<xsl:output method="text"/>
5
6<xsl:param select="'generic'" name="format"/>
7<xsl:param select="'unit'" name="pkgname"/>
8<xsl:param select="'change_log_conf.xml'" name="configuration"/>
9<xsl:param name="curdate"/>
10<xsl:param name="curtime"/>
9
10<xsl:variable select="document($configuration)/configuration" name="conf"/>
11
12<xsl:variable name="start">
13 <xsl:choose>
14 <xsl:when test="$format='rpm'">
15 <xsl:value-of select="$conf/rpm/start"/>
16 </xsl:when>

--- 37 unchanged lines hidden (view full) ---

54<xsl:variable name="br">&lt;br&gt;</xsl:variable>
55
56
57<xsl:template match="/"> <xsl:apply-templates select="change_log"/> </xsl:template>
58<xsl:template match="change_log"> <xsl:apply-templates select="changes"/> </xsl:template>
59
60
61<xsl:template match="changes">
11
12<xsl:variable select="document($configuration)/configuration" name="conf"/>
13
14<xsl:variable name="start">
15 <xsl:choose>
16 <xsl:when test="$format='rpm'">
17 <xsl:value-of select="$conf/rpm/start"/>
18 </xsl:when>

--- 37 unchanged lines hidden (view full) ---

56<xsl:variable name="br">&lt;br&gt;</xsl:variable>
57
58
59<xsl:template match="/"> <xsl:apply-templates select="change_log"/> </xsl:template>
60<xsl:template match="change_log"> <xsl:apply-templates select="changes"/> </xsl:template>
61
62
63<xsl:template match="changes">
62 <xsl:variable name="pday"> <xsl:call-template name="padded_day"><xsl:with-param select="@date" name="date"/></xsl:call-template></xsl:variable>
63 <xsl:variable name="dow"> <xsl:call-template name="day_of_week"><xsl:with-param select="@date" name="date"/></xsl:call-template></xsl:variable>
64 <xsl:variable name="date_"> <xsl:call-template name="getdate"><xsl:with-param select="@date" name="date"/><xsl:with-param select="$curdate" name="curdate"/></xsl:call-template></xsl:variable>
65 <xsl:variable name="time_"> <xsl:call-template name="gettime"><xsl:with-param select="@time" name="time"/><xsl:with-param select="$curtime" name="curtime"/></xsl:call-template></xsl:variable>
66 <xsl:variable name="pday"> <xsl:call-template name="padded_day"><xsl:with-param select="$date_" name="date"/></xsl:call-template></xsl:variable>
67 <xsl:variable name="dow"> <xsl:call-template name="day_of_week"><xsl:with-param select="$date_" name="date"/></xsl:call-template></xsl:variable>
64 <xsl:variable name="apply"> <xsl:call-template name="string_in_list"><xsl:with-param select="@apply" name="list"/><xsl:with-param select="$pkgname" name="string"/></xsl:call-template></xsl:variable>
65 <xsl:variable name="pkgname_"> <xsl:call-template name="beautify"><xsl:with-param select="$pkgname" name="pkgname"/></xsl:call-template></xsl:variable>
66
67 <xsl:choose>
68 <xsl:when test="$pkgname='unit' and $format='generic' and @rev!=1"/>
69 <xsl:otherwise>
70 <xsl:if test="$apply=$pkgname">
71
72 <xsl:if test="$format='generic'">
73 <xsl:text>&#10;</xsl:text>
74
75 <xsl:value-of select="substring(concat($conf/changes/title,
76 $pkgname_,
77 ' ', @ver,
78 ' '),
79 1, $conf/changes/length)"/>
80
68 <xsl:variable name="apply"> <xsl:call-template name="string_in_list"><xsl:with-param select="@apply" name="list"/><xsl:with-param select="$pkgname" name="string"/></xsl:call-template></xsl:variable>
69 <xsl:variable name="pkgname_"> <xsl:call-template name="beautify"><xsl:with-param select="$pkgname" name="pkgname"/></xsl:call-template></xsl:variable>
70
71 <xsl:choose>
72 <xsl:when test="$pkgname='unit' and $format='generic' and @rev!=1"/>
73 <xsl:otherwise>
74 <xsl:if test="$apply=$pkgname">
75
76 <xsl:if test="$format='generic'">
77 <xsl:text>&#10;</xsl:text>
78
79 <xsl:value-of select="substring(concat($conf/changes/title,
80 $pkgname_,
81 ' ', @ver,
82 ' '),
83 1, $conf/changes/length)"/>
84
81 <xsl:value-of select="substring(@date, 9, 2)"/>
82 <xsl:value-of select="$conf/changes/month[number(substring(current()/@date,
83 6, 2))]"/>
84 <xsl:value-of select="substring(@date, 1, 4)"/>
85 <xsl:value-of select="substring($date_, 9, 2)"/>
86 <xsl:value-of select="$conf/changes/month[number(substring($date_, 6, 2))]"/>
87 <xsl:value-of select="substring($date_, 1, 4)"/>
85 </xsl:if>
86
87 <xsl:if test="$format='rpm'">
88 <xsl:value-of select="concat('* ', $conf/changes/day[number($dow)],
88 </xsl:if>
89
90 <xsl:if test="$format='rpm'">
91 <xsl:value-of select="concat('* ', $conf/changes/day[number($dow)],
89 $conf/changes/month[number(substring(current()/@date, 6, 2))],
92 $conf/changes/month[number(substring($date_, 6, 2))],
90 $pday, ' ',
93 $pday, ' ',
91 substring(@date, 1, 4), ' ', @packager, ' - ',
94 substring($date_, 1, 4), ' ', @packager, ' - ',
92 @ver, '-', @rev, '%{?dist}.ngx')"/>
93 </xsl:if>
94
95 <xsl:if test="$format='deb'">
96 <xsl:value-of select="concat($pkgname, ' (', @ver, '-', @rev,
97 '~%%CODENAME%%) %%CODENAME%%; urgency=low')"/>
98
99 <xsl:text>&#10;</xsl:text>

--- 4 unchanged lines hidden (view full) ---

104 <xsl:apply-templates select="change"/>
105
106 <xsl:text>&#10;</xsl:text>
107
108 <xsl:if test="$format='deb'">
109 <xsl:value-of select="concat(' -- ', @packager, ' ',
110 $conf/changes/day[number($dow)], ', ',
111 $pday,
95 @ver, '-', @rev, '%{?dist}.ngx')"/>
96 </xsl:if>
97
98 <xsl:if test="$format='deb'">
99 <xsl:value-of select="concat($pkgname, ' (', @ver, '-', @rev,
100 '~%%CODENAME%%) %%CODENAME%%; urgency=low')"/>
101
102 <xsl:text>&#10;</xsl:text>

--- 4 unchanged lines hidden (view full) ---

107 <xsl:apply-templates select="change"/>
108
109 <xsl:text>&#10;</xsl:text>
110
111 <xsl:if test="$format='deb'">
112 <xsl:value-of select="concat(' -- ', @packager, ' ',
113 $conf/changes/day[number($dow)], ', ',
114 $pday,
112 $conf/changes/month[number(substring(current()/@date, 6, 2))],
113 substring(@date, 1, 4), ' ', @time)"/>
115 $conf/changes/month[number(substring($date_, 6, 2))],
116 substring($date_, 1, 4), ' ', $time_)"/>
114
115 <xsl:text>&#10;</xsl:text>
116 <xsl:text>&#10;</xsl:text>
117 </xsl:if>
118 </xsl:if>
119 </xsl:otherwise>
120 </xsl:choose>
121</xsl:template>

--- 119 unchanged lines hidden (view full) ---

241 <xsl:when test="$pkgname='unit'">Unit</xsl:when>
242 <xsl:otherwise>
243 <xsl:value-of select="$pkgname"/>
244 </xsl:otherwise>
245 </xsl:choose>
246</xsl:template>
247
248
117
118 <xsl:text>&#10;</xsl:text>
119 <xsl:text>&#10;</xsl:text>
120 </xsl:if>
121 </xsl:if>
122 </xsl:otherwise>
123 </xsl:choose>
124</xsl:template>

--- 119 unchanged lines hidden (view full) ---

244 <xsl:when test="$pkgname='unit'">Unit</xsl:when>
245 <xsl:otherwise>
246 <xsl:value-of select="$pkgname"/>
247 </xsl:otherwise>
248 </xsl:choose>
249</xsl:template>
250
251
252<xsl:template name="getdate"><xsl:param name="date"/><xsl:param name="curdate"/>
253 <xsl:choose>
254 <xsl:when test="$date=''">
255 <xsl:value-of select="$curdate"/>
256 </xsl:when>
257 <xsl:otherwise>
258 <xsl:value-of select="$date"/>
259 </xsl:otherwise>
260 </xsl:choose>
261</xsl:template>
262
263
264<xsl:template name="gettime"><xsl:param name="time"/><xsl:param name="curtime"/>
265 <xsl:choose>
266 <xsl:when test="$time=''">
267 <xsl:value-of select="$curtime"/>
268 </xsl:when>
269 <xsl:otherwise>
270 <xsl:value-of select="$time"/>
271 </xsl:otherwise>
272 </xsl:choose>
273</xsl:template>
274
275
249<xsl:template match="at">@</xsl:template>
250<xsl:template match="br"> <xsl:value-of select="$br"/> </xsl:template>
251<xsl:template match="nobr"> <xsl:value-of select="translate(., ' ', '&#xA0;')"/> </xsl:template>
252
253
254</xsl:stylesheet>
276<xsl:template match="at">@</xsl:template>
277<xsl:template match="br"> <xsl:value-of select="$br"/> </xsl:template>
278<xsl:template match="nobr"> <xsl:value-of select="translate(., ' ', '&#xA0;')"/> </xsl:template>
279
280
281</xsl:stylesheet>