3 # Add2TestDB -- add the current test to the lsof test suite DB
5 # This script saves the current TestDB file in TestDB.old and adds
6 # the words in config.cflags to it. "-D" prefixes on the words are
7 # removed, the words are sorted, and they are joint in a single
8 # line that is catenated to TestDB if it isn't already there.
10 # $Id: Add2TestDB,v 1.2 2002/04/19 11:53:37 abe Exp $
12 # Check for config.flags.
14 if test ! -r config.cflags
16 echo "$0: no ./config.cflags file"
20 # Check for a current data base file.
24 echo "$0: no ./TestDB file"
28 # Form a new data base line.
31 for i in `sort < config.cflags`
33 w=`echo $i | sed 's/^-D//'`
42 # See if the new line is already in the data base.
44 grep "$new" TestDB > /dev/null 2>&1
47 echo "\"$new\" is already in TestDB."
51 # Build a new data base file.
55 echo "$0: can't write the following to the end of TestDB:"
62 echo "$new" >> TestDB.new
64 # Archive the current data base file, if possible.
69 dtm="========== $dt =========="
72 echo "$dtm" >> OLD/TestDB
74 echo "$dtm" > OLD/TestDB
76 cat TestDB >> OLD/TestDB
79 # Put the new data base file in place.
82 echo "\"$new\" added to TestDB."