sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
sqlite / tool / srctree-check.tcl
| 1 | #!/usr/bin/tclsh |
| 2 | # |
| 3 | # Run this script from the top of the source tree in order to confirm that |
| 4 | # various aspects of the source tree are up-to-date. Items checked include: |
| 5 | # |
| 6 | # * Makefile.msc and autoconf/Makefile.msc agree |
| 7 | # * VERSION agrees with autoconf/tea/configure.ac |
| 8 | # |
| 9 | # Other tests might be added later. |
| 10 | # |
| 11 | # Error messages are printed and the process exists non-zero if problems |
| 12 | # are found. If everything is ok, no output is generated and the process |
| 13 | # exits with 0. |
| 14 | # |
| 15 | |
| 16 | # Read an entire file. |
| 17 | # |
| 18 | proc readfile {filename} { |
| 19 | set fd [open $filename rb] |
| 20 | set txt [read $fd] |
| 21 | close $fd |
| 22 | return $txt |
| 23 | } |
| 24 | |
| 25 | # Find the root of the tree. |
| 26 | # |
| 27 | set ROOT [file dir [file dir [file normalize $argv0]]] |
| 28 | |
| 29 | # Name of the TCL interpreter |
| 30 | # |
| 31 | set TCLSH [info nameofexe] |
| 32 | |
| 33 | # Number of errors seen. |
| 34 | # |
| 35 | set NERR 0 |
| 36 | |
| 37 | ######################### autoconf/Makefile.msc ############################### |
| 38 | |
| 39 | set f1 [readfile $ROOT/autoconf/Makefile.msc] |
| 40 | exec $TCLSH $ROOT/tool/mkmsvcmin.tcl $ROOT/Makefile.msc tmp1.txt |
| 41 | set f2 [readfile tmp1.txt] |
| 42 | file delete tmp1.txt |
| 43 | if {$f1 != $f2} { |
| 44 | puts "ERROR: ./autoconf/Makefile.msc does not agree with ./Makefile.msc" |
| 45 | puts "...... Fix: tclsh tool/mkmsvcmin.tcl" |
| 46 | incr NERR |
| 47 | } |