From: dan Date: Fri, 22 Jan 2016 14:32:20 +0000 (+0000) Subject: Update the schemalint.tcl script so that the argument to a -select option may be... X-Git-Tag: version-3.22.0~147^2~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a494ca8d12761b3b1ee89019811a3803ed5a252f;p=thirdparty%2Fsqlite.git Update the schemalint.tcl script so that the argument to a -select option may be either an SQL statement or the name of a file containing an SQL statement FossilOrigin-Name: d4e37767671dc946b8a21d0158fc3044e36f0c7e --- diff --git a/manifest b/manifest index 7fe67fd96f..cc75817d97 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\srule\sto\smain.mk\sto\sbuild\sthe\sschemalint.tcl\sscript\sinto\san\sexecutable.\sSimilar\sto\sthe\sway\sthe\ssqlite3_analyzer\sexecutable\sis\sbuilt. -D 2015-11-30T19:16:00.031 +C Update\sthe\sschemalint.tcl\sscript\sso\sthat\sthe\sargument\sto\sa\s-select\soption\smay\sbe\seither\san\sSQL\sstatement\sor\sthe\sname\sof\sa\sfile\scontaining\san\sSQL\sstatement +D 2016-01-22T14:32:20.666 F Makefile.in d828db6afa6c1fa060d01e33e4674408df1942a1 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc e928e68168df69b353300ac87c10105206653a03 @@ -1381,7 +1381,7 @@ F tool/replace.tcl 7727c60a04299b65a92f5e1590896fea0f25b9e0 F tool/restore_jrnl.tcl 6957a34f8f1f0f8285e07536225ec3b292a9024a F tool/rollback-test.c 9fc98427d1e23e84429d7e6d07d9094fbdec65a5 F tool/run-speed-test.sh 0ae485af4fe9f826e2b494be8c81f8ca9e222a4a -F tool/schemalint.tcl 045481a427ecdb72d11a0b0ef8725e7b892a09b9 +F tool/schemalint.tcl 7b94e303b02d1b1724c56201ed9fa2845dc8d3a5 F tool/showdb.c d4476e000a64eca9f5e2c2f68741e747b9778e8d F tool/showjournal.c 5bad7ae8784a43d2b270d953060423b8bd480818 F tool/showlocks.c 9920bcc64f58378ff1118caead34147201f48c68 @@ -1406,7 +1406,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 451e0fafbe5b7e9c67d9b584d5e16796c3196881 -R 8aa86746f90305c3990fbec7bea3f626 +P b8251065db9dbe5463490316baa09dc636551377 +R 6851215977a26ab67201b1a70341660d U dan -Z e9b16724c3379c54748ede3fe8135436 +Z 63a5088a2207bef48ca5ab65d0652925 diff --git a/manifest.uuid b/manifest.uuid index d723846430..3a22438944 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b8251065db9dbe5463490316baa09dc636551377 \ No newline at end of file +d4e37767671dc946b8a21d0158fc3044e36f0c7e \ No newline at end of file diff --git a/tool/schemalint.tcl b/tool/schemalint.tcl index 99e3476661..2755ba8828 100644 --- a/tool/schemalint.tcl +++ b/tool/schemalint.tcl @@ -47,6 +47,13 @@ proc list_to_sql {L} { join $ret ", " } +proc readfile {zFile} { + set fd [open $zFile] + set data [read $fd] + close $fd + return $data +} + proc process_cmdline_args {ctxvar argv} { upvar $ctxvar G set nArg [llength $argv] @@ -58,7 +65,12 @@ proc process_cmdline_args {ctxvar argv} { -select { incr i if {$i>=[llength $argv]-1} usage - lappend G(lSelect) [lindex $argv $i] + set zSelect [lindex $argv $i] + if {[file readable $zSelect]} { + lappend G(lSelect) [readfile $zSelect] + } else { + lappend G(lSelect) $zSelect + } } -verbose { set ::VERBOSE 1