#!/usr/bin/bash # # handy script for jumping to cvsweb. # see http://www.kohsuke.org/cvsweb/ target=$1 if [ "$target" == "" ]; then target=. fi if [ -d $target ]; then dir=$target file= else dir=$(dirname $target) file=/$(basename $target) fi cd $dir if [ ! -e CVS/Root ]; then echo no CVS/Root exit 1 fi line=$(cat $HOME/.cvsweb | grep $(cat CVS/Root) | head -n 1) if [ "$line" == "" ]; then echo no web site registered for $(cat CVS/Root) exit 1 fi url=$(echo $line | awk '{print $2}') url=$(echo $url | sed -e "s:%%P:$(cat CVS/Repository)$file:g") echo $url