add a preflight sqlite version check
Ted Unangst tedu@tedunangst.com
Wed, 13 Mar 2024 16:33:40 -0400
2 files changed,
20 insertions(+),
6 deletions(-)
M
preflight.sh
→
preflight.sh
@@ -9,11 +9,25 @@ echo go 1.18+ is required
false fi -if [ \! \( -e /usr/include/sqlite3.h -o -e /usr/local/include/sqlite3.h -o `uname` = "Darwin" \) ] ; then - echo unable to find sqlite3.h header - echo please install libsqlite3 dev package - false +sqlhdr= +if [ `uname` = "Darwin" ] ; then + : # okay +else + if [ -e /usr/include/sqlite3.h ] ; then + sqlhdr=/usr/include/sqlite3.h + elif [ -e /usr/local/include/sqlite3.h ] ; then + sqlhdr=/usr/local/include/sqlite3.h + else + echo unable to find sqlite3.h header + echo please install libsqlite3 dev package + false + fi + sqlvers=`grep "#define SQLITE_VERSION_NUMBER" $sqlhdr | cut -f3 -d' '` + if [ $sqlvers -lt 3034000 ] ; then + echo sqlite3.h header is too old: $sqlvers + echo version 3.34.0+ is required + false + fi fi touch .preflightcheck -