diff options
Diffstat (limited to 'bdb/dist/s_recover')
-rwxr-xr-x | bdb/dist/s_recover | 75 |
1 files changed, 39 insertions, 36 deletions
diff --git a/bdb/dist/s_recover b/bdb/dist/s_recover index b0593cfc052..331ae623d3f 100755 --- a/bdb/dist/s_recover +++ b/bdb/dist/s_recover @@ -1,23 +1,18 @@ #!/bin/sh - -# $Id: s_recover,v 1.3 2000/03/30 05:24:36 krinsky Exp $ +# $Id: s_recover,v 1.14 2002/03/27 04:31:51 bostic Exp $ # # Build the automatically generated logging/recovery files. -DIR="db btree hash log qam txn" +tmp=/tmp/__db_a +loglist=/tmp/__db_b +source=/tmp/__db_c +header=/tmp/__db_d +template=/tmp/__db_e -t=/tmp/__db_$$ -loglist=../test/logtrack.list -rm -f $t -rm -f $loglist +trap 'rm -f $tmp $loglist $source $header $template; exit 1' 1 2 3 13 15 +trap 'rm -f $tmp $loglist $source $header $template; exit 0' 0 -trap 'rm -f $t; exit 1' 1 2 3 13 15 - -# Use the standard -k option if it works; -# otherwise fall back on the traditional notation. -if sort -k 1,1 /dev/null -then sort_2_etc='-k 2' -else sort_2_etc='+1' -fi +DIR="db dbreg btree hash qam txn" # Check to make sure we haven't duplicated a log record entry, and build # the list of log record types that the test suite uses. @@ -27,38 +22,46 @@ for i in $DIR; do # Grab the PREFIX; there should only be one per file, and # so it's okay to just take the first. grep '^PREFIX' $f | sed q - egrep '^DEPRECATED[ ]|^BEGIN[ ]' $f | \ + egrep '^BEGIN[ ]|^IGNORED[ ]|^DEPRECATED[ ]' $f | awk '{print $1 "\t" $2 "\t" $3}' done done > $loglist -grep -v '^PREFIX' $loglist | awk '{print $2 "\t" $3}' | \ - sort $sort_2_etc -n | \ - uniq -d -f 1 > $t -[ -s $t ] && { +grep -v '^PREFIX' $loglist | + awk '{print $2 "\t" $3}' | sort -n -k 2 | uniq -d -f 1 > $tmp +[ -s $tmp ] && { echo "DUPLICATE LOG VALUES:" - cat $t - rm -f $t + cat $tmp + rm -f $tmp exit 1 } -rm -f $t +f=../test/logtrack.list +cmp $loglist $f > /dev/null 2>&1 || + (echo "Building $f" && rm -f $f && cp $loglist $f && chmod 444 $f) -for i in db btree hash log qam txn; do +# Build DB's recovery routines. +for i in db dbreg btree fileops hash qam txn; do for f in ../$i/*.src; do subsystem=`basename $f .src` - header_file=../include/${subsystem}_auto.h - source_file=../$i/${subsystem}_auto.c - template_file=template/rec_${subsystem} - template_source=. - - echo "Building $source_file, $header_file, $template_file" - rm -f $header_file $source_file $template_file awk -f gen_rec.awk \ - -v subsystem=$subsystem \ - -v source_file=$source_file \ - -v header_file=$header_file \ - -v template_file=$template_file \ - -v template_dir=. < $f - chmod 444 $header_file $source_file $template_file + -v source_file=$source \ + -v header_file=$header \ + -v template_file=$template < $f + + f=../dbinc_auto/${subsystem}_auto.h + cmp $header $f > /dev/null 2>&1 || + (echo "Building $f" && + rm -f $f && cp $header $f && chmod 444 $f) + f=../$i/${subsystem}_auto.c + cmp $source $f > /dev/null 2>&1 || + (echo "Building $f" && + rm -f $f && cp $source $f && chmod 444 $f) + f=template/rec_${subsystem} + cmp $template $f > /dev/null 2>&1 || + (echo "Building $f" && + rm -f $f && cp $template $f && chmod 444 $f) done done + +# Build the example application's recovery routines. +(cd ../examples_c/ex_apprec && sh auto_rebuild) |