summaryrefslogtreecommitdiff
path: root/dist/cvsshow
blob: 6899dbc3bb06dbb534644ea46c517ef3544f3b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
#
# $Id: cvsshow 7385 2002-08-01 18:51:44Z rstory $
#
export CVS_RSH=ssh
TAG=

if [ $# -eq 0 ]; then
	DIR=.
else
	if [ $# -ne 1 ]; then
		echo "usage: $0 <working directory>"
		exit
	fi
	DIR=$1
fi

if [ ! -d $DIR ]; then
	echo "no such directory '$DIR'"
	exit
fi

if [ ! -d $DIR/CVS ]; then
	echo "'$DIR' has no CVS directory!"
	exit
fi

if [ ! -f $DIR/CVS/Repository ]; then
	echo "'$DIR' has no CVS/Repository!"
	exit
fi

if [ ! -f $DIR/CVS/Root ]; then
	echo "'$DIR' has no CVS/Root!"
	exit
fi

if [ -f $DIR/CVS/Tag ]; then
	TAG="-r `cat $DIR/CVS/Tag | cut -c 2-`"
fi

REP="`cat $DIR/CVS/Repository`"
ROOT="`cat $DIR/CVS/Root`"

echo "Directory $DIR is rooted at $ROOT, $TAG $REP..."
echo "update with cvs -z3 -d $ROOT -q co $TAG -d $DIR $REP"