1 #!/bin/bash
   2 
   3 if echo $1 | grep -q '^-p' ; then
   4     PROJ=$(echo $1 | cut -d = -f 2)
   5     shift
   6 fi
   7 
   8 bin_dir=$(dirname $0)
   9 db_file=$1
  10 if [ "$db_file" == "" ] ; then
  11     echo "usage: $0 -p=<project> <db_file>"
  12     exit
  13 fi
  14 
  15 test -e  ${bin_dir}/${PROJ}.return_fixes && \
  16 cat ${bin_dir}/${PROJ}.return_fixes | \
  17 while read func old new ; do
  18     echo "update return_states set return = '$new' where function = '$func' and return = '$old';" | sqlite3 $db_file
  19 done
  20