Add extra checks for the validity of a numeric literal to sqlite3DequoteNumber().
[sqlite.git] / tool / mktoolzip.tcl
blob885bae960b80a4ea38703019bef46ac00cdf4ea0
1 #!/usr/bin/tclsh
3 # Run this script in order to generate a ZIP archive containing various
4 # command-line tools.
6 # The makefile that invokes this script must first build the following
7 # binaries:
9 # testfixture -- used to run this script
10 # sqlite3 -- the SQLite CLI
11 # sqldiff -- Program to diff two databases
12 # sqlite3_analyzer -- Space analyzer
14 switch $tcl_platform(os) {
15 {Windows NT} {
16 set OS win32
17 set EXE .exe
19 Linux {
20 set OS linux
21 set EXE {}
23 Darwin {
24 set OS osx
25 set EXE {}
27 default {
28 set OS unknown
29 set EXE {}
32 switch $tcl_platform(machine) {
33 arm64 {
34 set ARCH arm64
36 x86_64 {
37 set ARCH x64
39 amd64 -
40 intel {
41 if {$tcl_platform(pointerSize)==4} {
42 set ARCH x86
43 } else {
44 set ARCH x64
47 default {
48 set ARCH unk
51 set in [open [file join [file dirname [file dirname [info script]]] VERSION]]
52 set vers [read $in]
53 close $in
54 scan $vers %d.%d.%d v1 v2 v3
55 set v2 [format 3%02d%02d00 $v2 $v3]
56 set name sqlite-tools-$OS-$ARCH-$v2.zip
58 if {$OS=="win32"} {
59 # The win32 tar.exe supports the -a ("auto-compress") option. This causes
60 # tar to create an archive type based on the extension of the output file.
61 # In this case, a zip file.
62 puts "tar -a -cf $name sqlite3$EXE sqldiff$EXE sqlite3_analyzer$EXE"
63 puts [exec tar -a -cf $name sqlite3$EXE sqldiff$EXE sqlite3_analyzer$EXE]
64 puts "$name: [file size $name] bytes"
65 } else {
66 puts "zip $name sqlite3$EXE sqldiff$EXE sqlite3_analyzer$EXE"
67 puts [exec zip $name sqlite3$EXE sqldiff$EXE sqlite3_analyzer$EXE]
68 puts [exec ls -l $name]