db: store "too common" functions in the database
[smatch.git] / smatch_data / db / create_db.sh
blobf62edeb5fd8584f054ef222aa20ccfe7bd0ba6d2
1 #!/bin/bash
3 if echo $1 | grep -q '^-p' ; then
4 PROJ=$(echo $1 | cut -d = -f 2)
5 shift
6 fi
8 info_file=$1
10 if [[ "$info_file" = "" ]] ; then
11 echo "Usage: $0 -p=<project> <file with smatch messages>"
12 exit 1
15 bin_dir=$(dirname $0)
16 db_file=smatch_db.sqlite
18 rm -f $db_file
20 for i in ${bin_dir}/*.schema ; do
21 cat $i | sqlite3 $db_file
22 done
24 for i in ${bin_dir}/fill_* ; do
25 $i "$PROJ" $info_file
26 done
28 if [ "$PROJ" != "" ] ; then
29 ${bin_dir}/fixup_${PROJ}.sh