50e953a810 2008-03-17 drh: #!/usr/bin/tclsh 50e953a810 2008-03-17 drh: # 50e953a810 2008-03-17 drh: # Run this script to build the "download" page on standard output. 50e953a810 2008-03-17 drh: # 50e953a810 2008-03-17 drh: # 50e953a810 2008-03-17 drh: puts \ 50e953a810 2008-03-17 drh: {<html> 50e953a810 2008-03-17 drh: <head> 50e953a810 2008-03-17 drh: <title>Fossil Download</title> 50e953a810 2008-03-17 drh: </head> 50e953a810 2008-03-17 drh: <body> 50e953a810 2008-03-17 drh: <h1>Fossil Download</h1> 50e953a810 2008-03-17 drh: 50e953a810 2008-03-17 drh: <p> 50e953a810 2008-03-17 drh: This page contains prebuilt binaries for 50e953a810 2008-03-17 drh: <a href="index.html">fossil</a> for various architectures. 50e953a810 2008-03-17 drh: The source code is available in the 50e953a810 2008-03-17 drh: <a href="http://www.fossil-scm.org/fossil/timeline">self-hosting 50e953a810 2008-03-17 drh: fossil repository</a>. 50e953a810 2008-03-17 drh: </p> 50e953a810 2008-03-17 drh: 50e953a810 2008-03-17 drh: <table cellpadding="5"> 50e953a810 2008-03-17 drh: } 50e953a810 2008-03-17 drh: 50e953a810 2008-03-17 drh: proc Product {pattern desc} { 50e953a810 2008-03-17 drh: set flist [glob -nocomplain download/$pattern] 50e953a810 2008-03-17 drh: foreach file [lsort -dict $flist] { 50e953a810 2008-03-17 drh: set file [file tail $file] 50e953a810 2008-03-17 drh: if {![regexp -- {-([a-f0-9]{10})[^a-f0-9]} $file all version]} continue 50e953a810 2008-03-17 drh: set mtime [file mtime download/$file] 50e953a810 2008-03-17 drh: set date [clock format $mtime -format {%Y-%m-%d %H:%M:%S UTC} -gmt 1] 50e953a810 2008-03-17 drh: set size [file size download/$file] 50e953a810 2008-03-17 drh: set units bytes 50e953a810 2008-03-17 drh: if {$size>1024*1024} { 50e953a810 2008-03-17 drh: set size [format %.2f [expr {$size/(1024.0*1024.0)}]] 50e953a810 2008-03-17 drh: set units MiB 50e953a810 2008-03-17 drh: } elseif {$size>1024} { 50e953a810 2008-03-17 drh: set size [format %.2f [expr {$size/(1024.0)}]] 50e953a810 2008-03-17 drh: set units KiB 50e953a810 2008-03-17 drh: } 50e953a810 2008-03-17 drh: puts "<tr><td width=\"10\"></td>" 50e953a810 2008-03-17 drh: puts "<td valign=\"top\" align=\"right\">" 50e953a810 2008-03-17 drh: puts "<a href=\"download/$file\">$file</a></td>" 50e953a810 2008-03-17 drh: puts "<td width=\"5\"></td>" 50e953a810 2008-03-17 drh: regsub -all VERSION $desc $version d2 50e953a810 2008-03-17 drh: puts "<td valign=\"top\">[string trim $d2].<br>Size: $size $units.<br>" 50e953a810 2008-03-17 drh: puts "Created: $date</td></tr>" 50e953a810 2008-03-17 drh: } 50e953a810 2008-03-17 drh: } 50e953a810 2008-03-17 drh: 50e953a810 2008-03-17 drh: Product fossil-linux-x86-*.gz { 50e953a810 2008-03-17 drh: Prebuilt fossil binary version [VERSION] for Linux on x86 50e953a810 2008-03-17 drh: } 50e953a810 2008-03-17 drh: Product fossil-maxosx-x86-*.gz { 50e953a810 2008-03-17 drh: Prebuilt fossil binary version [VERSION] for MacOSX on x86 50e953a810 2008-03-17 drh: } 50e953a810 2008-03-17 drh: Product fossil-w32-*.zip { 50e953a810 2008-03-17 drh: Prebuilt fossil binary version [VERSION] for windows 50e953a810 2008-03-17 drh: } 50e953a810 2008-03-17 drh: 50e953a810 2008-03-17 drh: 50e953a810 2008-03-17 drh: puts {</table> 50e953a810 2008-03-17 drh: </body> 50e953a810 2008-03-17 drh: </html> 50e953a810 2008-03-17 drh: }