SQLite

Check-in [e985f02d20]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Download page reports sizes in MiB and KiB instead of just bytes. (CVS 2718)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e985f02d20d50b0451bfd35a7343e0386336dd71
User & Date: drh 2005-09-17 19:28:46.000
Context
2005-09-19
12:37
Change some debugging #defines in order to get SSE working again after recent upgrades. (CVS 2719) (check-in: 86eb7d8363 user: drh tags: trunk)
2005-09-17
19:28
Download page reports sizes in MiB and KiB instead of just bytes. (CVS 2718) (check-in: e985f02d20 user: drh tags: trunk)
19:14
Update to the download page on the website. (CVS 2717) (check-in: 91bc0d0032 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to www/download.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21








22
23
24
25
26
27
28
29
30
31
#
# Run this TCL script to generate HTML for the download.html file.
#
set rcsid {$Id: download.tcl,v 1.21 2005/09/17 19:14:40 drh Exp $}
source common.tcl
header {SQLite Download Page}

puts {
<h2>SQLite Download Page</h1>
<table width="100%" cellpadding="5">
}

proc Product {pattern desc} {
  regsub VERSION $pattern {([0-9][0-9a-z._]+)} p2
  set p2 [string map {* .*} $p2]
  regsub VERSION $pattern {*} p3
  set flist [glob -nocomplain $p3]
  foreach file [lsort -dict $flist] {
    if {![regexp ^$p2\$ $file all version]} continue
    regsub -all _ $version . version
    set size [file size $file]








    puts "<tr><td width=\"10\"></td>"
    puts "<td valign=\"top\" align=\"right\">"
    puts "<a href=\"$file\">$file</a><br>($size bytes)</td>"
    puts "<td width=\"5\"></td>"
    regsub -all VERSION $desc $version d2
    puts "<td valign=\"top\">[string trim $d2]</td></tr>"
  }
}
cd doc




|

















>
>
>
>
>
>
>
>


|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# Run this TCL script to generate HTML for the download.html file.
#
set rcsid {$Id: download.tcl,v 1.22 2005/09/17 19:28:46 drh Exp $}
source common.tcl
header {SQLite Download Page}

puts {
<h2>SQLite Download Page</h1>
<table width="100%" cellpadding="5">
}

proc Product {pattern desc} {
  regsub VERSION $pattern {([0-9][0-9a-z._]+)} p2
  set p2 [string map {* .*} $p2]
  regsub VERSION $pattern {*} p3
  set flist [glob -nocomplain $p3]
  foreach file [lsort -dict $flist] {
    if {![regexp ^$p2\$ $file all version]} continue
    regsub -all _ $version . version
    set size [file size $file]
    set units bytes
    if {$size>1024*1024} {
      set size [format %.2f [expr {$size/(1024.0*1024.0)}]]
      set units MiB
    } elseif {$size>1024} {
      set size [format %.2f [expr {$size/(1024.0)}]]
      set units KiB
    }
    puts "<tr><td width=\"10\"></td>"
    puts "<td valign=\"top\" align=\"right\">"
    puts "<a href=\"$file\">$file</a><br>($size $units)</td>"
    puts "<td width=\"5\"></td>"
    regsub -all VERSION $desc $version d2
    puts "<td valign=\"top\">[string trim $d2]</td></tr>"
  }
}
cd doc