#! /bin/sh # It was a pain updating all the copyrights in the Berkeley DB tree: I'm not # doing that again, the only files carrying copyrights in the WiredTiger tree # are the source files, that is, *.[ch] and *.in. Check automatically to be # sure the copyright is up-to-date. c1=__wt.1$$ c2=__wt.2$$ c3=__wt.3$$ c4=__wt.4$$ trap 'rm -f $c1 $c2 $c3 $c4; exit 0' 0 1 2 3 13 15 year=`date +%Y` cat > $c1 < $c2 < $c3 < $c4 < /dev/null`; then return; fi # It's okay if the file doesn't exist: we may be running in a release # tree with some files removed. test -f ../$i || return # Check for a correct copyright header. if `sed -e 2,4p -e 5q -e d ../$1 | diff - $c1 > /dev/null` ; then return; fi if `sed -e 2,3p -e 4q -e d ../$1 | diff - $c2 > /dev/null` ; then return; fi if `sed -e 3,5p -e 6q -e d ../$1 | diff - $c3 > /dev/null` ; then return; fi if `sed -e 3,4p -e 5q -e d ../$1 | diff - $c4 > /dev/null` ; then return; fi echo "$1: copyright information is incorrect" } l=`cd .. && \ echo LICENSE \ COPYING \ examples/c/*.c \ examples/python/*.py \ lang/java/src/com/wiredtiger/*.java \ lang/java/src/com/wiredtiger/*/*.java \ lang/python/*.py \ lang/python/*pack*.py \ src/include/*.[hi] \ src/include/*.in \ src/utilities/*.[ch] && \ find test/format test/salvage test/suite test/thread \ -name '*.[ch]' -o -name '*.py' -print` for i in $l `sed -e '/^[a-z]/! d' filelist`; do check $i done # The documentation copyright appears in two files. s="Copyright (c) 2008-$year WiredTiger, Inc." f="docs/build-javadoc.sh docs/style/footer.html" for i in $f; do if `grep "$s" ../$i > /dev/null`; then continue; fi echo "$i: copyright information is incorrect" done # The wt utility has a copyright it displays. s="printf.*Copyright (c) 2008-$year WiredTiger, Inc." f="src/utilities/util_cpyright.c" for i in $f; do if `grep "$s" ../$i > /dev/null`; then continue; fi echo "$i: copyright information is incorrect" done