Skip to content

Commit 83439b4

Browse files
committed
introduce OPENGROK_DERBY_URL for selecting JavaDB instance
fixes #656 fixes #529
1 parent faa3359 commit 83439b4

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

OpenGrok

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
# - OPENGROK_DERBY if set, then indexer tries to use derby as
5353
# historycache (see derby command of this
5454
# script)
55+
# - OPENGROK_DERBY_URL Use specific URL to JavaDB, e.g.
56+
# "jdbc:derby://localhost:1528/cachedb;create=true"
57+
# (default port is 1527)
5558
# - OPENGROK_TAG Enable parsing of revision tags into the History
5659
# view
5760
# - READ_XML_CONFIGURATION file with read only configuration
@@ -305,7 +308,10 @@ ${BZR:+-Dorg.opensolaris.opengrok.history.Bazaar=$BZR} \
305308
#
306309
if [ -n "${OPENGROK_DERBY}" ]
307310
then
308-
DERBY_HISTORY_CACHE="-D"
311+
DERBY_OPTIONS="-D"
312+
if [ -n "${OPENGROK_DERBY_URL}" ]; then
313+
DERBY_OPTIONS="${DERBY_OPTIONS} -u ${OPENGROK_DERBY_URL}"
314+
fi
309315
fi
310316

311317
# OPTIONAL: Show revision tags in History view.
@@ -657,8 +663,23 @@ ValidateConfiguration()
657663

658664
if [ -n "${OPENGROK_DERBY}" ]
659665
then
660-
Warning "CHECK: derbyclient.jar needs to be in where the rest of " \
661-
"opengrok used jars are and in unpacked source.war in WEB-INF/lib !"
666+
if [ `uname -s` == "SunOS" -a -d /opt/SUNWjavadb -a -d /usr/opengrok ];
667+
then
668+
if [ -d "/var/tomcat6" -a \
669+
! -r "/var/tomcat6/webapps/source/WEB-INF/lib/derbyclient.jar" ];
670+
then
671+
FatalError "JavaDB on but no derbyclient.jar under" \
672+
"/var/tomcat6/webapps/source/WEB-INF/lib"
673+
fi
674+
if [ ! -r "/usr/opengrok/lib/derbyclient.jar" ]; then
675+
FatalError "JavaDB on but no derbyclient.jar under" \
676+
"/usr/opengrok/lib"
677+
fi
678+
else
679+
Warning "CHECK: derbyclient.jar needs to be in where the rest of " \
680+
"opengrok used jars are and in unpacked source.war in " \
681+
"WEB-INF/lib !"
682+
fi
662683
fi
663684
}
664685

@@ -730,7 +751,7 @@ StdInvocation()
730751
${JAVA_DEBUG} \
731752
-jar ${OPENGROK_JAR} \
732753
${IGNORE_PATTERNS} ${ENABLE_PROJECTS} \
733-
${DERBY_HISTORY_CACHE} \
754+
${DERBY_OPTIONS} \
734755
${HISTORY_TAGS} \
735756
${SCAN_FOR_REPOSITORY} ${REMOTE_REPOSITORIES} \
736757
${SCAN_DEPTH} \

README.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,13 @@ Copy it over from:
443443
Solaris 11: /opt/SUNWjavadb/lib/derbyclient.jar
444444
Debian: /usr/lib/jvm/java-6-sun/db/lib/derbyclient.jar
445445

446-
For example on Solaris 11 with bundled Java DB and Tomcat the command
447-
will be:
446+
For example on Solaris 11 with bundled Java DB and Tomcat and OpenGrok
447+
installed from the OSOLopengrok package the command will be:
448448

449449
# cp /opt/SUNWjavadb/lib/derbyclient.jar \
450450
/var/tomcat6/webapps/source/WEB-INF/lib/
451+
# cp /opt/SUNWjavadb/lib/derbyclient.jar \
452+
/usr/opengrok/lib
451453

452454
3) Use these options with indexer when indexing/generating the configuration:
453455
-D -H

0 commit comments

Comments
 (0)