diff options
author | Hideki Yamane <henrich@debian.org> | 2014-03-30 19:38:48 +0900 |
---|---|---|
committer | Hideki Yamane <henrich@debian.org> | 2014-03-30 19:38:48 +0900 |
commit | 7769a9595c3da9a35f31b42451b1f6c3ed4004fa (patch) | |
tree | 009bf8fd68af6bb1129e07dd8c1ed205010d81f8 /dist/cvsshow | |
parent | 2e7891b0311204e0ecd5dc4a4334df01f3a6a1b4 (diff) | |
download | pkg-net-snmp-7769a9595c3da9a35f31b42451b1f6c3ed4004fa.tar.gz |
Imported Upstream version 5.7.2~dfsg
Diffstat (limited to 'dist/cvsshow')
-rwxr-xr-x | dist/cvsshow | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/dist/cvsshow b/dist/cvsshow new file mode 100755 index 0000000..7539595 --- /dev/null +++ b/dist/cvsshow @@ -0,0 +1,69 @@ +#!/bin/sh +# +export CVS_RSH=ssh +TAG= + +do_cvs() +{ + DIR=$1 + 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" +} + +do_svn() +{ + DIR=$1 + if [ ! -d $DIR/.svn ]; then + echo "'$DIR' has no .svn/ subdir!" + exit + fi + + ROOT=`svn info | grep URL|cut -f2 -d " "` + if [ -z "$ROOT" ]; then + echo "Couldn't find root from $DIR/.svn/entries" + exit 1 + fi + + echo "Directory $DIR is rooted at $ROOT..." + echo " update with svn co $ROOT $DIR" +} + +if [ $# -eq 0 ]; then + DIRS=. +else + DIRS=$@ +fi + +for d in $DIRS +do + if [ ! -d $d ]; then + echo "no such directory '$d'" + exit + fi + + if [ -d $d/CVS ]; then + do_cvs $d + elif [ -d $d/.svn ]; then + do_svn $d + else + echo "'$d' has neither CVS nor SVN information!" + fi +done + |