aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-29 20:52:51 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-29 20:52:51 +0000
commit0a832cee6349fd7033fa53bdff302eedc64e927e (patch)
tree345ecae19e4009401172de3097a6b5e34a94a2f6
parent6fc4a02ca62cd064ccb0396b7fe21825af667e6d (diff)
downloadgnunet-gtk-0a832cee6349fd7033fa53bdff302eedc64e927e.tar.gz
gnunet-gtk-0a832cee6349fd7033fa53bdff302eedc64e927e.zip
adding code for ChangeLog generation
-rw-r--r--ChangeLog258
-rw-r--r--Makefile.am13
-rw-r--r--contrib/svn2cl.xsl494
3 files changed, 507 insertions, 258 deletions
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 5c476e6b..00000000
--- a/ChangeLog
+++ /dev/null
@@ -1,258 +0,0 @@
1Mon Oct 31 11:53:57 CET 2011
2 Releasing gnunet-gtk 0.9.0pre4.
3
4Mon Sep 19 14:25:55 CEST 2011
5 Releasing gnunet-gtk 0.9.0pre3.
6
7Fri Sep 9 10:43:26 CEST 2011
8 Initial draft for gnunet-peerinfo-gtk.
9 Fixing issues when compiling against Gtk 3.0 (which is now
10 required since we are clearly getting increasingly
11 incompatible with Gtk 2.6).
12
13Mon Aug 15 16:18:22 CEST 2011
14 Merging gnunet-setup and gnunet-gtk projects.
15
16Mon Nov 1 13:03:59 CET 2010
17 gnunet-setup started.
18
19Thu Dec 23 23:37:09 CET 2010
20 Releasing gnunet-gtk 0.9.0pre2.
21
22Sat Jul 3 20:47:22 CEST 2010
23 Releasing gnunet-gtk 0.9.0pre1.
24
25Sun Jun 6 00:47:21 CEST 2010
26 Upgrade to gettext-0.17.
27 Starting to track changes for gnunet-gtk 0.9.x-branch.
28
29Fri Feb 12 22:30:44 CET 2010
30 Releasing gnunet-gtk 0.8.1a.
31
32Tue Dec 29 12:24:04 CET 2009
33 Releasing gnunet-gtk 0.8.1.
34
35Sun Jul 20 15:28:04 MDT 2008
36 Releasing gnunet-gtk 0.8.0a.
37
38Sat Jun 14 00:54:39 MDT 2008
39 Releasing gnunet-gtk 0.8.0.
40
41Wed Jun 11 23:00:38 MDT 2008
42 Fixed icon installation and telling GTK about our
43 icon path.
44
45Sat Jun 7 17:54:49 MDT 2008
46 Added support for new namespace APIs. Chat now uses
47 an icon to indicate which of the room members is the
48 local user. Allowed user to leave chat room. Fixed
49 warnings and various minor UI glitches.
50
51Sun Jun 1 21:11:54 MDT 2008
52 Releasing 0.8.0pre1.
53
54Sun May 18 17:28:43 MDT 2008
55 Removed libltdl tests and directory. We do not need
56 those anymore since we use libgnunetutil anyway.
57
58Sun Mar 2 19:13:39 MST 2008
59 Releasing gnunet-gtk 0.8.0pre0.
60
61Sat Mar 1 23:07:18 MST 2008
62 Added DHT (dstore) utilization statistics.
63 Added trust (earned/spend/awarded) statistics.
64
65Sat Feb 9 19:39:24 MST 2008
66 Fixed lifelock caused by buggy semaphore operations
67 in event thread handler. Added suspend/resume for
68 searches. Added visual changes on aborted searches.
69 Removed timeout and max-result options from search
70 dialog (no longer required by ECRS/FSUI). Fixed
71 signed/unsigned type issues in stats. Migrated
72 gnunet-gtk GLADE file to GLADE-3 GUI (still getting
73 warnings).
74
75Thu Dec 20 19:54:19 MST 2007
76 Releasing gnunet-gtk 0.7.3.
77
78Sat Sep 29 16:57:14 MDT 2007
79 Releasing gnunet-gtk 0.7.2c.
80
81Fri Aug 24 19:49:21 MDT 2007
82 Fixing a few memory leaks. Reducing memory
83 consumption of flag images (by sharing flag
84 instances between different peers).
85
86Mon Jul 30 00:39:20 MDT 2007
87 Releasing gnunet-gtk 0.7.2b.
88
89Sat Jul 7 02:37:10 MDT 2007
90 Releasing gnunet-gtk 0.7.2a.
91
92Fri Jul 6 23:07:42 MDT 2007
93 Fixed build issues with autoconf 1.10.
94
95Sun Jun 17 00:09:13 MDT 2007
96 Releasing gnunet-gtk 0.7.2.
97
98Sun Jun 10 19:32:33 MDT 2007
99 Completed support for namespaces.
100
101Thu May 31 20:53:50 MDT 2007
102 Added peer-info tab. You must load the new "peers" module
103 to see it.
104
105Thu May 31 01:30:23 MDT 2007
106 Added color-coding of search results.
107 Added warning (red background) if anonymity level is zero.
108 Fixed (rare) deadlock.
109
110Sun Mar 25 13:49:12 MDT 2007
111 Releasing gnunet-gtk 0.7.1c.
112
113Thu Mar 1 00:03:44 MST 2007
114 Fixing issues with gettext (wrong path).
115
116Sat Feb 24 15:43:14 MST 2007
117 Improved performance of statistics querying code
118 (O(n^2) to O(n) where n is number of stats).
119
120Thu Feb 15 21:54:15 MST 2007
121 Added IO load statistics.
122
123Sun Feb 11 13:53:13 MST 2007
124 Releasing GNUnet 0.7.1b.
125
126Thu Feb 8 13:40:11 MST 2007
127 Upgrade to gettext-0.16.1.
128 Minor bugfix in build process (#1182).
129
130Sat Feb 3 22:03:52 MST 2007
131 Added ability to open gnunet-directory.
132
133Sat Feb 3 21:00:23 MST 2007
134 Added ability to save search results as gnunet-directory
135 (in right-click context menu).
136
137Sun Jan 28 20:16:46 MST 2007
138 Added ability to copy URIs of search results and
139 uploads to clipboard.
140
141Fri Dec 22 19:21:07 MST 2006
142 Releasing gnunet-gtk 0.7.1.
143
144Mon Dec 11 21:41:58 MST 2006
145 Releasing gnunet-gtk 0.7.1pre2.
146
147Sun Dec 10 00:35:16 MST 2006
148 Fixed deadlocks in FS plugin.
149
150Sun Dec 3 14:47:46 MST 2006
151 Buttons that cannot be used are now disabled.
152 Started downloads are marked using a yellow
153 background for size field in the search dialog.
154 Completed downloads are marked using a green
155 background. When manually entering a path
156 for uploads, switch between recursive and
157 file-only is now automatic. It is now possible
158 to remove keywords and metadata in the upload
159 dialog.
160
161Wed Nov 15 23:17:36 MST 2006
162 Updated to GNUnet 0.7.1pre0 APIs. Disabled
163 incomplete or broken portions of FS API.
164 Added additional statistics on datastore.
165 Releasing gnunet-gtk 0.7.1pre0.
166
167Sat May 20 08:37:02 PDT 2006
168 Fixed some deadlocks and other minor bugs.
169 Releasing gnunet-gtk 0.7.0e.
170
171Sat May 13 19:45:41 PDT 2006
172 Added some additional stats.
173
174Sat May 6 00:17:59 PDT 2006
175 Releasing gnunet-gtk 0.7.0d.
176
177Wed Apr 26 10:33:43 PDT 2006
178 Added french translation.
179
180Sun Apr 23 05:30:17 PDT 2006
181 Cleaner shutdown code for open search windows, avoiding some
182 (harmless) crashes in certain versions of GTK library on exit.
183
184Sat Apr 22 13:50:39 PDT 200
185 Improved signaling in gtk-common library, resulting in better response times
186 (especially noticeable during shutdown).
187
188Sat Apr 1 16:24:27 PST 2006
189 Improved shutdown code.
190
191Sat Mar 25 10:14:44 PST 2006
192 Adding .desktop support.
193
194Sat Jan 7 02:38:37 PST 2006
195 Adding Swedish translation.
196
197Fri Dec 23 15:59:19 PST 2005
198 Releasing 0.7.0b.
199
200Sat Nov 19 16:13:19 PST 2005
201 Releasing 0.7.0a.
202
203Sun Aug 28 01:17:43 PDT 2005
204 Fixed various minor bugs, cleaned up name selection for downloads.
205 Releasing 0.7.0.
206
207Tue Aug 23 00:47:31 PDT 2005
208 Fixed bugs in shutdown sequence (unclean with respect to LOG,
209 resulted in warnings under certain circumstances).
210
211Sun Aug 21 19:57:19 PDT 2005
212 Fixed deadlock in download abort code.
213
214Sun Aug 21 18:42:14 PDT 2005
215 Fixed deadlock in gnunet-gtk shutdown.
216
217Sat Aug 20 21:06:56 PDT 2005
218 Added support for toggling collection of file identifiers.
219
220Sat Aug 20 13:51:01 PDT 2005
221 Releasing 0.7.0pre6.
222
223Thu Aug 18 21:18:28 PDT 2005
224 Made quotations match GNU standards.
225
226Wed Aug 17 23:51:13 PDT 2005
227 Fixed various minor bugs, including memory leaks.
228 Implemented auto-renaming.
229
230Mon Jul 18 01:30:09 CEST 2005
231 Releasing 0.7.0pre5.
232
233Fri Jul 15 13:06:40 CEST 2005
234 Fixed problem with gnunet-gtk hanging on shutdown.
235
236Sun Jul 10 00:59:03 CEST 2005
237 Added stats plugin. Made gettext (internationalization)
238 work. Minor bugfixes.
239
240Tue Jul 5 01:48:30 CEST 2005
241 Refactored code to use plugins for the different
242 applications (die monolithic code, die!).
243
244Sat Jul 2 17:21:07 CEST 2005
245 Fixed omissions from glade file. Implemented
246 aborting downloads and clearing completed
247 downloads. Releasing 0.7.0pre4.
248
249Mon Jun 27 17:21:09 CEST 2005
250 Merged old GNUnet po files for i18n.
251 Updated glade file for proper interaction
252 with intltool (do not translate dummy labels).
253
254Sun Jun 26 18:21:17 CEST 2005
255 Released 0.7.0pre3 (first release).
256
257Mon May 23 11:06:02 EST 2005
258 Started serious coding on glade-based gnunet-gtk.
diff --git a/Makefile.am b/Makefile.am
index 4ae076c3..010914d2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,3 +19,16 @@ install-data-local:
19EXTRA_DIST = \ 19EXTRA_DIST = \
20 config.rpath \ 20 config.rpath \
21 install-sh mkinstalldirs 21 install-sh mkinstalldirs
22
23ChangeLog:
24 if test -f $(top_srcdir)/.svn/entries; then \
25 svn log -v --xml -r HEAD:18395 | \
26 xsltproc --stringparam ignore-message-starting "-" \
27 --stringparam strip-prefix "gnunet" \
28 --stringparam include-rev "yes" $(top_srcdir)/contrib/svn2cl.xsl - > $@; \
29 fi
30
31dist: ChangeLog
32
33.PHONY: ChangeLog
34
diff --git a/contrib/svn2cl.xsl b/contrib/svn2cl.xsl
new file mode 100644
index 00000000..3d9db020
--- /dev/null
+++ b/contrib/svn2cl.xsl
@@ -0,0 +1,494 @@
1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4
5 svn2cl.xsl - xslt stylesheet for converting svn log to a normal
6 changelog
7
8 version 0.11
9
10 Usage (replace ++ with two minus signs which aren't allowed
11 inside xml comments):
12 svn ++verbose ++xml log | \
13 xsltproc ++stringparam strip-prefix `basename $(pwd)` \
14 ++stringparam linelen 75 \
15 ++stringparam groupbyday yes \
16 ++stringparam separate-daylogs yes \
17 ++stringparam include-rev yes \
18 ++stringparam include-actions yes \
19 ++stringparam breakbeforemsg yes/2 \
20 ++stringparam reparagraph yes \
21 ++stringparam authorsfile FILE \
22 ++stringparam ignore-message-starting \
23 svn2cl.xsl - > ChangeLog
24
25 This file is based on several implementations of this conversion
26 that I was not completely happy with and some other common
27 xslt constructs found on the web.
28
29 Copyright (C) 2004, 2005, 2006, 2007 Arthur de Jong.
30
31 Redistribution and use in source and binary forms, with or without
32 modification, are permitted provided that the following conditions
33 are met:
34 1. Redistributions of source code must retain the above copyright
35 notice, this list of conditions and the following disclaimer.
36 2. Redistributions in binary form must reproduce the above copyright
37 notice, this list of conditions and the following disclaimer in
38 the documentation and/or other materials provided with the
39 distribution.
40 3. The name of the author may not be used to endorse or promote
41 products derived from this software without specific prior
42 written permission.
43
44 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
45 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
46 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
48 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
50 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
51 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
52 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
53 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
54 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55
56-->
57
58<!DOCTYPE xsl:stylesheet [
59 <!ENTITY space "&#32;">
60]>
61
62<xsl:stylesheet
63 version="1.0"
64 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
65
66 <xsl:output
67 method="text"
68 encoding="utf-8"
69 media-type="text/plain"
70 omit-xml-declaration="yes"
71 standalone="yes"
72 indent="no" />
73
74 <xsl:strip-space elements="*" />
75
76 <!-- the prefix of pathnames to strip -->
77 <xsl:param name="strip-prefix" select="'/'" />
78
79 <!-- the length of a line to wrap messages at -->
80 <xsl:param name="linelen" select="75" />
81
82 <!-- whether entries should be grouped by day -->
83 <xsl:param name="groupbyday" select="'no'" />
84
85 <!-- whether to seperate log messages by empty lines -->
86 <xsl:param name="separate-daylogs" select="'no'" />
87
88 <!-- whether a revision number should be included -->
89 <xsl:param name="include-rev" select="'no'" />
90
91 <!-- whether aaction labels should be added to files -->
92 <xsl:param name="include-actions" select="'no'" />
93
94 <!-- whether the log message should start on a new line -->
95 <xsl:param name="breakbeforemsg" select="'no'" />
96
97 <!-- whether the message should be rewrapped within one paragraph -->
98 <xsl:param name="reparagraph" select="'no'" />
99
100 <!-- whether certain messages should be ignored -->
101 <xsl:param name="ignore-message-starting" select="''" />
102
103 <!-- location of authors file if any -->
104 <xsl:param name="authorsfile" select="''" />
105 <xsl:key name="author-lookup" match="author" use="@uid" />
106 <xsl:variable name="authors-top" select="document($authorsfile)/authors" />
107
108 <!-- match the topmost log entry -->
109 <xsl:template match="log">
110 <xsl:choose>
111 <xsl:when test="$ignore-message-starting != ''">
112 <!-- only handle logentries with don't contain the string -->
113 <xsl:apply-templates select="logentry[not(starts-with(msg,$ignore-message-starting))]" />
114 </xsl:when>
115 <xsl:otherwise>
116 <xsl:apply-templates select="logentry" />
117 </xsl:otherwise>
118 </xsl:choose>
119 <!-- add newlines at the end of the changelog -->
120 <xsl:text>&#xA;</xsl:text>
121 </xsl:template>
122
123 <!-- format one entry from the log -->
124 <xsl:template match="logentry">
125 <xsl:choose>
126 <!-- if we're grouping we should omit some headers -->
127 <xsl:when test="$groupbyday='yes'">
128 <!-- save log entry number -->
129 <xsl:variable name="pos" select="position()" />
130 <!-- fetch previous entry's date -->
131 <xsl:variable name="prevdate">
132 <xsl:apply-templates select="../logentry[position()=(($pos)-1)]/date" />
133 </xsl:variable>
134 <!-- fetch previous entry's author -->
135 <xsl:variable name="prevauthor">
136 <xsl:value-of select="normalize-space(../logentry[position()=(($pos)-1)]/author)" />
137 </xsl:variable>
138 <!-- fetch this entry's date -->
139 <xsl:variable name="date">
140 <xsl:apply-templates select="date" />
141 </xsl:variable>
142 <!-- fetch this entry's author -->
143 <xsl:variable name="author">
144 <xsl:value-of select="normalize-space(author)" />
145 </xsl:variable>
146 <!-- check if header is changed -->
147 <xsl:if test="($prevdate!=$date) or ($prevauthor!=$author)">
148 <!-- add newline -->
149 <xsl:if test="not(position()=1)">
150 <xsl:text>&#xA;</xsl:text>
151 </xsl:if>
152 <!-- date -->
153 <xsl:value-of select="$date" />
154 <!-- two spaces -->
155 <xsl:text>&space;&space;</xsl:text>
156 <!-- author's name -->
157 <xsl:apply-templates select="author" />
158 <!-- two newlines -->
159 <xsl:text>&#xA;</xsl:text>
160 <xsl:if test="$separate-daylogs!='yes'"><xsl:text>&#xA;</xsl:text></xsl:if>
161 </xsl:if>
162 </xsl:when>
163 <!-- write the log header -->
164 <xsl:otherwise>
165 <!-- add newline -->
166 <xsl:if test="not(position()=1)">
167 <xsl:text>&#xA;</xsl:text>
168 </xsl:if>
169 <!-- date -->
170 <xsl:apply-templates select="date" />
171 <!-- two spaces -->
172 <xsl:text>&space;&space;</xsl:text>
173 <!-- author's name -->
174 <xsl:apply-templates select="author" />
175 <!-- two newlines -->
176 <xsl:text>&#xA;&#xA;</xsl:text>
177 </xsl:otherwise>
178 </xsl:choose>
179 <!-- get paths string -->
180 <xsl:variable name="paths">
181 <xsl:apply-templates select="paths" />
182 </xsl:variable>
183 <!-- get revision number -->
184 <xsl:variable name="rev">
185 <xsl:if test="$include-rev='yes'">
186 <xsl:text>[r</xsl:text>
187 <xsl:value-of select="@revision" />
188 <xsl:text>]&space;</xsl:text>
189 </xsl:if>
190 </xsl:variable>
191 <!-- trim trailing newlines -->
192 <xsl:variable name="msg">
193 <!-- add a line break before the log message -->
194 <xsl:choose>
195 <xsl:when test="$breakbeforemsg='yes'">
196 <xsl:text>&#xA;</xsl:text>
197 </xsl:when>
198 <xsl:when test="number($breakbeforemsg)&gt;0">
199 <xsl:call-template name="newlines">
200 <xsl:with-param name="count" select="number($breakbeforemsg)" />
201 </xsl:call-template>
202 </xsl:when>
203 </xsl:choose>
204 <xsl:call-template name="trim-newln">
205 <xsl:with-param name="txt" select="msg" />
206 </xsl:call-template>
207 </xsl:variable>
208 <!-- add newline here if separate-daylogs is in effect -->
209 <xsl:if test="$groupbyday='yes' and $separate-daylogs='yes'"><xsl:text>&#xA;</xsl:text></xsl:if>
210 <!-- first line is indented (other indents are done in wrap template) -->
211 <xsl:text>&#x9;*&space;</xsl:text>
212 <!-- set up the text to wrap -->
213 <xsl:variable name="txt">
214 <xsl:value-of select="$rev" />
215 <xsl:if test="$paths!=''">
216 <xsl:value-of select="concat($paths,':&space;')" />
217 </xsl:if>
218 <xsl:value-of select="$msg" />
219 </xsl:variable>
220 <!-- print the paths and message nicely wrapped -->
221 <xsl:call-template name="wrap">
222 <xsl:with-param name="txt" select="$txt" />
223 </xsl:call-template>
224 </xsl:template>
225
226 <!-- format date -->
227 <xsl:template match="date">
228 <xsl:variable name="date" select="normalize-space(.)" />
229 <!-- output date part -->
230 <xsl:value-of select="substring($date,1,10)" />
231 <!-- output time part -->
232 <xsl:if test="$groupbyday!='yes'">
233 <xsl:text>&space;</xsl:text>
234 <xsl:value-of select="substring($date,12,5)" />
235 </xsl:if>
236 </xsl:template>
237
238 <!-- format author -->
239 <xsl:template match="author">
240 <xsl:variable name="uid" select="normalize-space(.)" />
241 <!-- try to lookup author in authorsfile -->
242 <xsl:choose>
243 <xsl:when test="$authorsfile!=''">
244 <xsl:for-each select="$authors-top">
245 <xsl:variable name="author" select="key('author-lookup',$uid)" />
246 <!-- present result -->
247 <xsl:choose>
248 <xsl:when test="string($author/.)">
249 <xsl:apply-templates select="$author/node()" mode="copy" />
250 </xsl:when>
251 <xsl:otherwise>
252 <xsl:value-of select="$uid" />
253 </xsl:otherwise>
254 </xsl:choose>
255 </xsl:for-each>
256 </xsl:when>
257 <xsl:otherwise>
258 <xsl:value-of select="$uid" />
259 </xsl:otherwise>
260 </xsl:choose>
261 </xsl:template>
262
263 <!-- copy but normalize text -->
264 <xsl:template match="text()" mode="copy">
265 <xsl:value-of select="normalize-space(.)" />
266 </xsl:template>
267
268 <!-- simple copy template -->
269 <xsl:template match="@*|node()" mode="copy">
270 <xsl:copy>
271 <xsl:apply-templates select="@*|node()" mode="copy" />
272 </xsl:copy>
273 </xsl:template>
274
275 <!-- present a list of paths names -->
276 <xsl:template match="paths">
277 <xsl:choose>
278 <!-- only handle paths that begin with the path and strip the path -->
279 <xsl:when test="$strip-prefix != ''">
280 <!-- if strip-prefix does not start with a slash, prepend it -->
281 <xsl:variable name="tmpstrip1">
282 <xsl:choose>
283 <xsl:when test="starts-with($strip-prefix,'/')">
284 <xsl:value-of select="$strip-prefix" />
285 </xsl:when>
286 <xsl:otherwise>
287 <xsl:value-of select="concat('/',$strip-prefix)" />
288 </xsl:otherwise>
289 </xsl:choose>
290 </xsl:variable>
291 <!-- strip trailing slash from strip-prefix -->
292 <xsl:variable name="tmpstrip2">
293 <xsl:choose>
294 <xsl:when test="substring($tmpstrip1,string-length($tmpstrip1),1)='/'">
295 <xsl:value-of select="substring($tmpstrip1,1,string-length($tmpstrip1)-1)" />
296 </xsl:when>
297 <xsl:otherwise>
298 <xsl:value-of select="$tmpstrip1" />
299 </xsl:otherwise>
300 </xsl:choose>
301 </xsl:variable>
302 <!-- filter on all entries within directory -->
303 <xsl:for-each select="path[starts-with(concat(normalize-space(.),'/'),concat($tmpstrip2,'/'))]">
304 <xsl:sort select="normalize-space(.)" data-type="text" />
305 <!-- unless we are the first entry, add a comma -->
306 <xsl:if test="not(position()=1)">
307 <xsl:text>,&space;</xsl:text>
308 </xsl:if>
309 <!-- print the path name -->
310 <xsl:call-template name="printpath">
311 <xsl:with-param name="path" select="substring(normalize-space(.),string-length($strip-prefix)+3)" />
312 </xsl:call-template>
313 <!-- add the action flag -->
314 <xsl:if test="$include-actions='yes'">
315 <xsl:apply-templates select="." mode="action"/>
316 </xsl:if>
317 </xsl:for-each>
318 </xsl:when>
319 <!-- print a simple list of all paths -->
320 <xsl:otherwise>
321 <xsl:for-each select="path">
322 <xsl:sort select="normalize-space(.)" data-type="text" />
323 <!-- unless we are the first entry, add a comma -->
324 <xsl:if test="not(position()=1)">
325 <xsl:text>,&space;</xsl:text>
326 </xsl:if>
327 <!-- print the path name -->
328 <xsl:value-of select="normalize-space(.)" />
329 <!-- add the action flag -->
330 <xsl:if test="$include-actions='yes'">
331 <xsl:apply-templates select="." mode="action"/>
332 </xsl:if>
333 </xsl:for-each>
334 </xsl:otherwise>
335 </xsl:choose>
336 </xsl:template>
337
338 <xsl:template match="path" mode="action">
339 <xsl:choose>
340 <xsl:when test="@action='D'">
341 <xsl:text>[DEL]</xsl:text>
342 </xsl:when>
343 <xsl:when test="@copyfrom-path">
344 <xsl:text>[CPY]</xsl:text>
345 </xsl:when>
346 <xsl:when test="@action='D'">
347 <xsl:text>[ADD]</xsl:text>
348 </xsl:when>
349 </xsl:choose>
350 </xsl:template>
351
352 <!-- transform path to something printable -->
353 <xsl:template name="printpath">
354 <!-- fetch the pathname -->
355 <xsl:param name="path" />
356 <!-- strip leading slash -->
357 <xsl:variable name="tmp1">
358 <xsl:choose>
359 <xsl:when test="starts-with($path,'/')">
360 <xsl:value-of select="substring($path,2)" />
361 </xsl:when>
362 <xsl:otherwise>
363 <xsl:value-of select="$path" />
364 </xsl:otherwise>
365 </xsl:choose>
366 </xsl:variable>
367 <!-- translate empty string to dot -->
368 <xsl:choose>
369 <xsl:when test="$tmp1 = ''">
370 <xsl:text>.</xsl:text>
371 </xsl:when>
372 <xsl:otherwise>
373 <xsl:value-of select="$tmp1" />
374 </xsl:otherwise>
375 </xsl:choose>
376 </xsl:template>
377
378 <!-- string-wrapping template -->
379 <xsl:template name="wrap">
380 <xsl:param name="txt" />
381 <xsl:variable name="normtxt" select="normalize-space($txt)" />
382 <xsl:choose>
383 <xsl:when test="contains($txt,'&#xA;')">
384 <!-- text contains newlines, do the first line -->
385 <xsl:call-template name="wrap">
386 <xsl:with-param name="txt" select="substring-before($txt,'&#xA;')" />
387 </xsl:call-template>
388 <!-- print tab -->
389 <xsl:text>&#x9;&space;&space;</xsl:text>
390 <!-- wrap the rest of the text -->
391 <xsl:call-template name="wrap">
392 <xsl:with-param name="txt" select="substring-after($txt,'&#xA;')" />
393 </xsl:call-template>
394 </xsl:when>
395 <xsl:when test="(string-length($normtxt) &lt; (($linelen)-9)) or not(contains($normtxt,' '))">
396 <!-- this is easy, nothing to do -->
397 <xsl:value-of select="$normtxt" />
398 <!-- add newline -->
399 <xsl:text>&#xA;</xsl:text>
400 </xsl:when>
401 <xsl:otherwise>
402 <!-- find the first line -->
403 <xsl:variable name="tmp" select="substring($normtxt,1,(($linelen)-9))" />
404 <xsl:variable name="line">
405 <xsl:choose>
406 <!-- if our attempt contains spaces wrap on that -->
407 <xsl:when test="contains($tmp,' ')">
408 <xsl:call-template name="find-line">
409 <xsl:with-param name="txt" select="$tmp" />
410 </xsl:call-template>
411 </xsl:when>
412 <!-- otherwise use the first non-space characters from the text -->
413 <xsl:otherwise>
414 <xsl:value-of select="substring-before($normtxt,' ')" />
415 </xsl:otherwise>
416 </xsl:choose>
417 </xsl:variable>
418 <!-- print line -->
419 <xsl:value-of select="$line" />
420 <!-- print newline and tab -->
421 <xsl:text>&#xA;&#x9;&space;&space;</xsl:text>
422 <!-- wrap the rest of the text -->
423 <xsl:call-template name="wrap">
424 <xsl:with-param name="txt" select="normalize-space(substring($normtxt,string-length($line)+1))" />
425 </xsl:call-template>
426 </xsl:otherwise>
427 </xsl:choose>
428 </xsl:template>
429
430 <!-- template to trim line to contain space as last char -->
431 <xsl:template name="find-line">
432 <xsl:param name="txt" />
433 <xsl:choose>
434 <xsl:when test="substring($txt,string-length($txt),1)=' '">
435 <xsl:value-of select="substring($txt,1,string-length($txt)-1)" />
436 </xsl:when>
437 <xsl:otherwise>
438 <xsl:call-template name="find-line">
439 <xsl:with-param name="txt" select="substring($txt,1,string-length($txt)-1)" />
440 </xsl:call-template>
441 </xsl:otherwise>
442 </xsl:choose>
443 </xsl:template>
444
445 <!-- template to trim trailing and starting newlines -->
446 <xsl:template name="trim-newln">
447 <xsl:param name="txt" />
448 <xsl:choose>
449 <!-- find starting newlines -->
450 <xsl:when test="substring($txt,1,1) = '&#xA;'">
451 <xsl:call-template name="trim-newln">
452 <xsl:with-param name="txt" select="substring($txt,2)" />
453 </xsl:call-template>
454 </xsl:when>
455 <!-- find trailing newlines -->
456 <xsl:when test="substring($txt,string-length($txt),1) = '&#xA;'">
457 <xsl:call-template name="trim-newln">
458 <xsl:with-param name="txt" select="substring($txt,1,string-length($txt)-1)" />
459 </xsl:call-template>
460 </xsl:when>
461 <!-- if the message has paragrapgs, find the first one -->
462 <xsl:when test="$reparagraph='yes' and contains($txt,'&#xA;&#xA;')">
463 <!-- remove newlines from first paragraph -->
464 <xsl:value-of select="normalize-space(substring-before($txt,'&#xA;&#xA;'))" />
465 <!-- paragraph separator -->
466 <xsl:text>&#xA;&#xA;</xsl:text>
467 <!-- do the rest of the text -->
468 <xsl:call-template name="trim-newln">
469 <xsl:with-param name="txt" select="substring-after($txt,'&#xA;&#xA;')" />
470 </xsl:call-template>
471 </xsl:when>
472 <!-- remove more single newlines -->
473 <xsl:when test="$reparagraph='yes'">
474 <xsl:value-of select="normalize-space($txt)" />
475 </xsl:when>
476 <!-- no newlines found, we're done -->
477 <xsl:otherwise>
478 <xsl:value-of select="$txt" />
479 </xsl:otherwise>
480 </xsl:choose>
481 </xsl:template>
482
483 <!-- insert a number of newlines -->
484 <xsl:template name="newlines">
485 <xsl:param name="count" />
486 <xsl:text>&#xA;</xsl:text>
487 <xsl:if test="$count&gt;1">
488 <xsl:call-template name="newlines">
489 <xsl:with-param name="count" select="($count)-1" />
490 </xsl:call-template>
491 </xsl:if>
492 </xsl:template>
493
494</xsl:stylesheet>