Debian Codegraph @

dist/s_je2db

raw symbols SCIP
1 #!/bin/sh -
2
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()
7
8 COPY_EXAMPLES=0
9
10 JEDIR=$1
11 if [ $# -eq 1 ] ; then
12 DBDIR=..
13 else
14 DBDIR=$2
15 fi
16
17 if [ ! -d "$DBDIR/src/dbinc" -o ! -f "$JEDIR/build.xml" ] ; then
18 echo >&2 "Usage $0 /path/to/je [ /path/to/db ]"
19 exit 1
20 fi
21
22 JEDIR=$(cd "$JEDIR" ; /bin/pwd)
23 DBDIR=$(cd "$DBDIR" ; /bin/pwd)
24
25 JESRC="$JEDIR/src"
26 JETEST="$JEDIR/test"
27 JEEXAMPLES="$JEDIR/examples"
28 DBSRC="$DBDIR/lang/java/src"
29 DBTEST="$DBDIR/test/java/compat/src"
30 DBEXAMPLES="$DBDIR/examples/java/src"
31 DIRMATCH="com/sleepycat/\(\(asm\)\|\(bind\)\|\(collections\)\|\(persist\)\|\(util\)\)/"
32 EXAMPLESMATCH="^\./\(\(collections\)\|\(persist\)\)"
33
34 cd "$JESRC"
35 for d in `find . -type d | grep -v CVS | grep $DIRMATCH` ; do
36 #echo "$DBSRC/$d"
37 mkdir -p "$DBSRC/$d"
38 done
39 cd "$JETEST"
40 for d in `find . -type d | grep -v CVS | grep $DIRMATCH` ; do
41 #echo "$DBTEST/$d"
42 mkdir -p "$DBTEST/$d"
43 done
44 if [ $COPY_EXAMPLES -eq 1 ] ; then
45 cd "$JEEXAMPLES"
46 for d in `find . -type d | grep -v CVS | grep $EXAMPLESMATCH` ; do
47 #echo "$DBEXAMPLES/$d"
48 mkdir -p "$DBEXAMPLES/$d"
49 done
50 fi
51
52 E1='s/com\.sleepycat\.je\.utilint\.IdentityHashMap/java.util.IdentityHashMap/g'
53 E2='s/com\.sleepycat\.je/com.sleepycat.db/g'
54 E3='/<!-- begin JE only -->/,/<!-- end JE only -->/d'
55 E4='s/LockConflictException/DeadlockException/g'
56 E5='s/$Id:.*\$/$Id$/'
57 E6='s/TransactionGettingStarted/gsg_txn\/JAVA/'
58 E7='s/OperationFailureException/DatabaseException/g'
59 EXCLUDESRC="\(\(ClassEnhancerTask\)\|\(DeletedClassException\)\|\(IncompatibleClassException\)\|\(StoreExistsException\)\|\(StoreNotFoundException\)\)"
60 EXCLUDETESTS="\(\(ConvertAndAddTest\)\|\(DevolutionTest\)\|\(TestVersionCompatibility\)\|\(XACollectionTest\)\|\(AddNewSecKeyToAbstractClassTest\)\|\(EvolveProxyClassTest\)\|\(CreateAbstractClassData\)\|\(CreateSecDupsWithoutComparator\)\|\(CreateSecDupsWithoutComparatorEvolve\)\|\(CreateOldVersionBigDecimalDb\)\|\(CreateStringDataDB\)\|\(ProxyToSimpleTypeTest\)\|\(SecondaryDupOrderEvolveTest\)\|\(SecondaryDupOrderTest\)\|\(StringFormatCompatibilityTest\)\)"
61
62 cd "$JESRC"
63 for f in `find . -name '*.java' -o -name "package.html" | grep $DIRMATCH | grep -v $EXCLUDESRC` ; do
64 #echo $DBSRC/$f
65 sed -e "$E1" -e "$E2" -e "$E3" -e "$E4" -e "$E5" -e "$E6" -e "$E7" < $f \
66 > $DBSRC/$f.sed.out
67 diff -q -I "\$\Id:" $DBSRC/$f $DBSRC/$f.sed.out || \
68 mv -f $DBSRC/$f.sed.out $DBSRC/$f
69 rm -f $DBSRC/$f.sed.out
70 done
71
72 cd "$JETEST"
73 for f in `find . -name '*.java' -o -name "*.java.original" | grep $DIRMATCH | grep -v $EXCLUDETESTS` \
74 ; do
75 #echo $DBTEST/$f
76 sed -e "$E1" -e "$E2" -e "$E3" -e "$E4" -e "$E5" -e "$E6" -e "$E7" < $f \
77 > $DBTEST/$f.sed.out
78 diff -q -I "\$\Id:" $DBTEST/$f $DBTEST/$f.sed.out || \
79 mv -f $DBTEST/$f.sed.out $DBTEST/$f
80 rm -f $DBTEST/$f.sed.out
81 done
82
83 if [ $COPY_EXAMPLES -eq 1 ] ; then
84 cd "$JEEXAMPLES"
85 for f in `find . -name '*.java' | grep $EXAMPLESMATCH` ; do
86 #echo $DBEXAMPLES/$f
87 sed -e "$E1" -e "$E2" -e "$E3" -e "$E4" -e "$E5" -e "$E6" -e "$E7" < $f \
88 > $DBEXAMPLES/$f.sed.out
89 diff -q -I "\$\Id:" $DBEXAMPLES/$f $DBEXAMPLES/$f.sed.out || \
90 mv -f $DBEXAMPLES/$f.sed.out $DBEXAMPLES/$f
91 rm -f $DBEXAMPLES/$f.sed.out
92 done
93 fi
94
95 exit 0