4 puts {mk_version.tcl [-v] IDMETA infile ..}
12 set arg [lindex $argv $i]
13 switch -glob -- $arg {
18 if {![info exists conffile]} {
27 if {![info exists infiles]} {
28 puts "mk_version.tcl: missing input file(s)"
32 set f [open $conffile r]
34 set cnt [gets $f line]
38 regexp {VERSION=([0-9.]+)} $line s version
42 set maps(VERSION) $version
44 set c [split $version .]
46 set versionl [expr ([lindex $c 0] * 256 + [lindex $c 1]) * 256 + [lindex $c 2]]
47 set maps(VERSION_HEX) [format %x $versionl]
49 if {[llength $c] == 3} {
52 set maps(WIN_FILEVERSION) [join $c ,]
54 set maps(VERSION_SHA1) {}
56 foreach x [array names maps] {
60 foreach ifile $infiles {
61 set if [open "${ifile}.in" r]
62 set of [open "${ifile}" w]
65 set cnt [gets $if line]
69 foreach x [array names maps] {
70 regsub -all "@$x@" $line $maps($x) line