3 # The examples must be hand-edited after they are copied:
4 # - add EnvironmentConfig.setInitializeCache(true), setInitializeLocking(true)
5 # - add DatabaseConfig.setType(DatabaseType.BTREE)
6 # - add null databaseName param to openDatabase() and openSecondaryDatabase()
11 if [ $# -eq 1 ] ; then
17 if [ ! -d "$DBDIR/dbinc" -o ! -f "$JEDIR/build.xml" ] ; then
18 echo >&2 "Usage $0 /path/to/je [ /path/to/db ]"
22 JEDIR=$(cd "$JEDIR" ; /bin/pwd)
23 DBDIR=$(cd "$DBDIR" ; /bin/pwd)
27 JEEXAMPLES="$JEDIR/examples"
28 DBSRC="$DBDIR/java/src"
29 DBTEST="$DBDIR/test/scr024/src"
30 DBEXAMPLES="$DBDIR/examples_java/src"
31 DIRMATCH="com/sleepycat/\(\(asm\)\|\(bind\)\|\(collections\)\|\(persist\)\|\(util\)\)"
32 EXAMPLESMATCH="^\./\(\(collections\)\|\(persist\)\)"
35 for d in `find . -type d | grep -v CVS | grep $DIRMATCH` ; do
40 for d in `find . -type d | grep -v CVS | grep $DIRMATCH` ; do
44 if [ $COPY_EXAMPLES -eq 1 ] ; then
46 for d in `find . -type d | grep -v CVS | grep $EXAMPLESMATCH` ; do
47 #echo "$DBEXAMPLES/$d"
48 mkdir -p "$DBEXAMPLES/$d"
52 E1='s/com\.sleepycat\.je/com.sleepycat.db/g'
53 E2='/<!-- begin JE only -->/,/<!-- end JE only -->/d'
54 E3='s/LockConflictException/DeadlockException/g'
56 E5='s/TransactionGettingStarted/gsg_txn\/JAVA/'
57 EXCLUDESRC="\(\(DeletedClassException\)\|\(IncompatibleClassException\)\|\(StoreExistsException\)\|\(StoreNotFoundException\)\)"
58 #EXCLUDESRC="\(\(ClassEnhancerTask\)\|\(DeletedClassException\)\|\(IncompatibleClassException\)\|\(StoreExistsException\)\|\(StoreNotFoundException\)\)"
59 EXCLUDETESTS="\(\(ConvertAndAddTest\)\|\(DevolutionTest\)\|\(TestVersionCompatibility\)\|\(XACollectionTest\)\)"
62 for f in `find . -name '*.java' -o -name "package.html" | grep $DIRMATCH | grep -v $EXCLUDESRC` ; do
64 sed -e "$E1" -e "$E2" -e "$E3" -e "$E4" -e "$E5" < $f \
66 diff -q -I "\$\Id:" $DBSRC/$f $DBSRC/$f.sed.out || \
67 mv -f $DBSRC/$f.sed.out $DBSRC/$f
68 rm -f $DBSRC/$f.sed.out
72 for f in `find . -name '*.java' -o -name "*.java.original" | grep $DIRMATCH | grep -v $EXCLUDETESTS` \
75 sed -e "$E1" -e "$E2" -e "$E3" -e "$E4" -e "$E5" < $f \
77 diff -q -I "\$\Id:" $DBTEST/$f $DBTEST/$f.sed.out || \
78 mv -f $DBTEST/$f.sed.out $DBTEST/$f
79 rm -f $DBTEST/$f.sed.out
82 if [ $COPY_EXAMPLES -eq 1 ] ; then
84 for f in `find . -name '*.java' | grep $EXAMPLESMATCH` ; do
86 sed -e "$E1" -e "$E2" -e "$E3" -e "$E4" -e "$E5" < $f \
87 > $DBEXAMPLES/$f.sed.out
88 diff -q -I "\$\Id:" $DBEXAMPLES/$f $DBEXAMPLES/$f.sed.out || \
89 mv -f $DBEXAMPLES/$f.sed.out $DBEXAMPLES/$f
90 rm -f $DBEXAMPLES/$f.sed.out