summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/dist/s_copyright
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/dist/s_copyright')
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_copyright101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/dist/s_copyright b/src/third_party/wiredtiger/dist/s_copyright
new file mode 100755
index 00000000000..893b2451f2c
--- /dev/null
+++ b/src/third_party/wiredtiger/dist/s_copyright
@@ -0,0 +1,101 @@
+#! /bin/sh
+
+# Check the copyrights.
+
+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 <<ENDOFTEXT
+ * Copyright (c) 2008-$year WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * See the file LICENSE for redistribution information.
+ENDOFTEXT
+
+# Copyright for files WiredTiger does not own.
+cat > $c2 <<ENDOFTEXT
+ * Public Domain 2008-$year WiredTiger, Inc.
+ *
+ * This is free and unencumbered software released into the public domain.
+ENDOFTEXT
+
+cat > $c3 <<ENDOFTEXT
+# Copyright (c) 2008-$year WiredTiger, Inc.
+# All rights reserved.
+#
+# See the file LICENSE for redistribution information.
+ENDOFTEXT
+
+cat > $c4 <<ENDOFTEXT
+# Public Domain 2008-$year WiredTiger, Inc.
+#
+# This is free and unencumbered software released into the public domain.
+ENDOFTEXT
+
+check()
+{
+ # Skip files in which WiredTiger holds no rights.
+ if `egrep "skip $1" s_copyright.list > /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
+ if `sed -e 1,2p -e 3q -e d ../$1 | diff - $c4 > /dev/null` ; then
+ return;
+ fi
+
+ echo "$1: copyright information is incorrect"
+}
+
+# Search for files, skipping some well-known 3rd party directories.
+for i in `cd .. &&
+ find [a-z]* -name '*.[chi]' \
+ -o -name '*.cxx' -o -name '*.in' -o -name '*.java' -o -name '*.py' |
+ sed -e '/Makefile.in/d' \
+ -e '/^build_posix\//d' \
+ -e '/api\/leveldb\/basho\//d' \
+ -e '/api\/leveldb\/hyperleveldb\//d' \
+ -e '/api\/leveldb\/leveldb\//d' \
+ -e '/api\/leveldb\/rocksdb\//d' \
+ -e '/test\/3rdparty\//d' \
+ -e 's/^\.\///'`
+do
+ check $i
+done
+
+# A few special cases: LICENSE, documentation, wt utility, some of which
+# have more than one copyright notice in the file.
+s="Copyright (c) 2008-$year WiredTiger, Inc."
+special_copyright()
+{
+ cnt=`grep "$s" ../$1 | wc -l`
+ if test $cnt -ne $2; then
+ echo "$1: copyright information is incorrect"
+ fi
+}
+
+special_copyright LICENSE 1
+special_copyright src/docs/build-javadoc.sh 1
+special_copyright src/docs/style/footer.html 2
+special_copyright src/utilities/util_cpyright.c 2