Friday April 10, 2009
Using CVS with OpenGrok
If you look at the mail archives for OpenGrok it seems that the most popular question out there right now is how to configure OpenGrok with CVS. Personally I have extremely limited experience with cvs, but I guess there is some old projects out there that haven't converted to a distributed scm system yet (check out http://www.selenic.com/mercurial/wiki/index.cgi/RepositoryConversion ;-)). In this blog I'll show you how to configure a project using cvs in OpenGrok.
I don't use cvs, so the first thing we need to do is to install cvs and create a cvs repository for our source. An empty cvs repository doesn't help us, so lets import the OpenGrok sources and use them in the example:
trond@opensolaris> pfexec pkg install SUNWcvs trond@opensolaris> pfexec zfs create -o mountpoint=/cvsroot rpool/cvsroot trond@opensolaris> pfexec chown trond:staff /cvsroot trond@opensolaris> cd /cvsroot trond@opensolaris> export CVSROOT=`pwd` trond@opensolaris> cvs init trond@opensolaris> cd /tmp trond@opensolaris> hg clone ssh://anon@hg.opensolaris.org/hg/opengrok/trunk opengrok trond@opensolaris> cd opengrok trond@opensolaris> rm -rf .hg trond@opensolaris> cvs import -m "Initial import of OpenGrok" opengrok opengrok-trunk start trond@opensolaris> rm -rf opengrok
I got my OpenGrok installation in /var/opengrok with the sources in /var/opengrok/source, so let's check out the sources:
trond@opensolaris> cd /var/opengrok/source trond@opensolaris> cvs co opengrok
The next thing we need to do is to update the configuration with the knowledge of the new project (and it's repository):
trond@opensolaris> cd /var/opengrok
trond@opensolaris> java -jar /var/opengrok/bin/opengrok.jar -c /var/opengrok/bin/ctags \
-v -s /var/opengrok/source -d /var/opengrok/data -S -P \
-p /opengrok -n -W /etc/opengrok/configuration.xml
(run look at the man page for a description of the different options).
With the new configuration in place, we can start the index generation:
trond@opensolaris> cd /var/opengrok trond@opensolaris> java -Xmx2g -jar /var/opengrok/bin/opengrok.jar -R /etc/opengrok/configuration.xml
So let's install tomcat and try it out:
trond@opensolaris> pfexec pkg install SUNWtcat trond@opensolaris> pfexec cp /var/opengrok/source.war /var/tomcat6/webapps trond@opensolaris> svcadm enable tomcat6
If you navigate to http://localhost:8080/source/history/opengrok/LICENSE.txt you should get the history for the LICENSE file and the annotate link should be available. You should be able to navigate around and look at the change history for the files in your repository. Please note that cvs operates on a pr file basis, so you cannot request history for a directory.
Posted at 02:44PM Apr 10, 2009 by trond in OpenGrok | Comments[3]