Fossil SCM

Handle eventual utf-8 correctly everywhere in download page

jan.nijtmans 2012-10-28 08:32 trunk
Commit 63565631d7030c87a6cbfbd7c3309368f75625a9
1 file changed +10 -5
--- www/mkdownload.tcl
+++ www/mkdownload.tcl
@@ -3,10 +3,11 @@
33
# Run this script to build the "download.html" page. Also generate
44
# the fossil_download_checksums.html page.
55
#
66
#
77
set out [open download.html w]
8
+fconfigure $out -encoding utf-8 -translation lf
89
puts $out \
910
{<!DOCTYPE html><html>
1011
<head>
1112
<base href="http://www.fossil-scm.org/" />
1213
<title>Fossil: Timeline</title>
@@ -33,13 +34,15 @@
3334
<a href='/fossil/reportlist'>Tickets</a>
3435
</div>
3536
<div class="content">
3637
<p>
3738
38
-<center><font size=4>
39
-<b>To install Fossil &rarr;</b> download the stand-alone executable
40
-and put it on your $PATH.
39
+<center><font size=4>}
40
+puts $out \
41
+"<b>To install Fossil \u2192</b> download the stand-alone executable"
42
+puts $out \
43
+{and put it on your $PATH.
4144
</font><p><small>
4245
RPMs available
4346
<a href="http://download.opensuse.org/repositories/home:/rmax:/fossil/">
4447
here.</a>
4548
Cryptographic checksums for download files are
@@ -65,11 +68,11 @@
6568
set dt [string range $datetime 0 3]-[string range $datetime 4 5]-
6669
append dt "[string range $datetime 6 7] "
6770
append dt "[string range $datetime 8 9]:[string range $datetime 10 11]:"
6871
append dt "[string range $datetime 12 13]"
6972
set link [string map {{ } +} $dt]
70
- set hr http://www.fossil-scm.org/fossil/timeline?c=$link&y=ci
73
+ set hr http://www.fossil-scm.org/fossil/timeline?c=$link&amp;y=ci
7174
puts $out "<tr><td colspan=6 align=left><hr>"
7275
puts $out "<center><b><a href=\"$hr\">$dt</a></b></center>"
7376
puts $out "</td></tr>"
7477
7578
foreach {prefix suffix img desc} {
@@ -99,10 +102,11 @@
99102
}
100103
puts $out "</tr>"
101104
if {[file exists download/releasenotes-$datetime.html]} {
102105
puts $out "<tr><td colspan=6 align=left>"
103106
set rn [open download/releasenotes-$datetime.html]
107
+ fconfigure $rn -encoding utf-8
104108
puts $out "[read $rn]"
105109
close $rn
106110
puts $out "</td></tr>"
107111
}
108112
}
@@ -116,10 +120,11 @@
116120
close $out
117121
118122
# Generate the checksum page
119123
#
120124
set out [open fossil_download_checksums.html w]
125
+fconfigure $out -encoding utf-8 -translation lf
121126
puts $out {<html>
122127
<title>Fossil Download Checksums</title>
123128
<body>
124129
<h1 align="center">Checksums For Fossil Downloads</h1>
125130
<p>The following table shows the SHA1 checksums for the precompiled
@@ -129,7 +134,7 @@
129134
130135
foreach file [lsort [glob -nocomplain download/fossil-*.zip]] {
131136
set sha1sum [lindex [exec sha1sum $file] 0]
132137
puts $out "$sha1sum [file tail $file]"
133138
}
134
-puts $out {</pre></body></html}
139
+puts $out {</pre></body></html>}
135140
close $out
136141
--- www/mkdownload.tcl
+++ www/mkdownload.tcl
@@ -3,10 +3,11 @@
3 # Run this script to build the "download.html" page. Also generate
4 # the fossil_download_checksums.html page.
5 #
6 #
7 set out [open download.html w]
 
8 puts $out \
9 {<!DOCTYPE html><html>
10 <head>
11 <base href="http://www.fossil-scm.org/" />
12 <title>Fossil: Timeline</title>
@@ -33,13 +34,15 @@
33 <a href='/fossil/reportlist'>Tickets</a>
34 </div>
35 <div class="content">
36 <p>
37
38 <center><font size=4>
39 <b>To install Fossil &rarr;</b> download the stand-alone executable
40 and put it on your $PATH.
 
 
41 </font><p><small>
42 RPMs available
43 <a href="http://download.opensuse.org/repositories/home:/rmax:/fossil/">
44 here.</a>
45 Cryptographic checksums for download files are
@@ -65,11 +68,11 @@
65 set dt [string range $datetime 0 3]-[string range $datetime 4 5]-
66 append dt "[string range $datetime 6 7] "
67 append dt "[string range $datetime 8 9]:[string range $datetime 10 11]:"
68 append dt "[string range $datetime 12 13]"
69 set link [string map {{ } +} $dt]
70 set hr http://www.fossil-scm.org/fossil/timeline?c=$link&y=ci
71 puts $out "<tr><td colspan=6 align=left><hr>"
72 puts $out "<center><b><a href=\"$hr\">$dt</a></b></center>"
73 puts $out "</td></tr>"
74
75 foreach {prefix suffix img desc} {
@@ -99,10 +102,11 @@
99 }
100 puts $out "</tr>"
101 if {[file exists download/releasenotes-$datetime.html]} {
102 puts $out "<tr><td colspan=6 align=left>"
103 set rn [open download/releasenotes-$datetime.html]
 
104 puts $out "[read $rn]"
105 close $rn
106 puts $out "</td></tr>"
107 }
108 }
@@ -116,10 +120,11 @@
116 close $out
117
118 # Generate the checksum page
119 #
120 set out [open fossil_download_checksums.html w]
 
121 puts $out {<html>
122 <title>Fossil Download Checksums</title>
123 <body>
124 <h1 align="center">Checksums For Fossil Downloads</h1>
125 <p>The following table shows the SHA1 checksums for the precompiled
@@ -129,7 +134,7 @@
129
130 foreach file [lsort [glob -nocomplain download/fossil-*.zip]] {
131 set sha1sum [lindex [exec sha1sum $file] 0]
132 puts $out "$sha1sum [file tail $file]"
133 }
134 puts $out {</pre></body></html}
135 close $out
136
--- www/mkdownload.tcl
+++ www/mkdownload.tcl
@@ -3,10 +3,11 @@
3 # Run this script to build the "download.html" page. Also generate
4 # the fossil_download_checksums.html page.
5 #
6 #
7 set out [open download.html w]
8 fconfigure $out -encoding utf-8 -translation lf
9 puts $out \
10 {<!DOCTYPE html><html>
11 <head>
12 <base href="http://www.fossil-scm.org/" />
13 <title>Fossil: Timeline</title>
@@ -33,13 +34,15 @@
34 <a href='/fossil/reportlist'>Tickets</a>
35 </div>
36 <div class="content">
37 <p>
38
39 <center><font size=4>}
40 puts $out \
41 "<b>To install Fossil \u2192</b> download the stand-alone executable"
42 puts $out \
43 {and put it on your $PATH.
44 </font><p><small>
45 RPMs available
46 <a href="http://download.opensuse.org/repositories/home:/rmax:/fossil/">
47 here.</a>
48 Cryptographic checksums for download files are
@@ -65,11 +68,11 @@
68 set dt [string range $datetime 0 3]-[string range $datetime 4 5]-
69 append dt "[string range $datetime 6 7] "
70 append dt "[string range $datetime 8 9]:[string range $datetime 10 11]:"
71 append dt "[string range $datetime 12 13]"
72 set link [string map {{ } +} $dt]
73 set hr http://www.fossil-scm.org/fossil/timeline?c=$link&amp;y=ci
74 puts $out "<tr><td colspan=6 align=left><hr>"
75 puts $out "<center><b><a href=\"$hr\">$dt</a></b></center>"
76 puts $out "</td></tr>"
77
78 foreach {prefix suffix img desc} {
@@ -99,10 +102,11 @@
102 }
103 puts $out "</tr>"
104 if {[file exists download/releasenotes-$datetime.html]} {
105 puts $out "<tr><td colspan=6 align=left>"
106 set rn [open download/releasenotes-$datetime.html]
107 fconfigure $rn -encoding utf-8
108 puts $out "[read $rn]"
109 close $rn
110 puts $out "</td></tr>"
111 }
112 }
@@ -116,10 +120,11 @@
120 close $out
121
122 # Generate the checksum page
123 #
124 set out [open fossil_download_checksums.html w]
125 fconfigure $out -encoding utf-8 -translation lf
126 puts $out {<html>
127 <title>Fossil Download Checksums</title>
128 <body>
129 <h1 align="center">Checksums For Fossil Downloads</h1>
130 <p>The following table shows the SHA1 checksums for the precompiled
@@ -129,7 +134,7 @@
134
135 foreach file [lsort [glob -nocomplain download/fossil-*.zip]] {
136 set sha1sum [lindex [exec sha1sum $file] 0]
137 puts $out "$sha1sum [file tail $file]"
138 }
139 puts $out {</pre></body></html>}
140 close $out
141

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button