Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / net-snmp / dist / cvsshow
1 #!/bin/bash
2 #
3 # $Id: cvsshow,v 1.1 2002/08/01 18:51:44 rstory Exp $
4 #
5 export CVS_RSH=ssh
6 TAG=
7
8 if [ $# -eq 0 ]; then
9         DIR=.
10 else
11         if [ $# -ne 1 ]; then
12                 echo "usage: $0 <working directory>"
13                 exit
14         fi
15         DIR=$1
16 fi
17
18 if [ ! -d $DIR ]; then
19         echo "no such directory '$DIR'"
20         exit
21 fi
22
23 if [ ! -d $DIR/CVS ]; then
24         echo "'$DIR' has no CVS directory!"
25         exit
26 fi
27
28 if [ ! -f $DIR/CVS/Repository ]; then
29         echo "'$DIR' has no CVS/Repository!"
30         exit
31 fi
32
33 if [ ! -f $DIR/CVS/Root ]; then
34         echo "'$DIR' has no CVS/Root!"
35         exit
36 fi
37
38 if [ -f $DIR/CVS/Tag ]; then
39         TAG="-r `cat $DIR/CVS/Tag | cut -c 2-`"
40 fi
41
42 REP="`cat $DIR/CVS/Repository`"
43 ROOT="`cat $DIR/CVS/Root`"
44
45 echo "Directory $DIR is rooted at $ROOT, $TAG $REP..."
46 echo "update with cvs -z3 -d $ROOT -q co $TAG -d $DIR $REP"