summaryrefslogtreecommitdiff
path: root/git-cvsimport-script
blob: 7a43e65592bfe366f172a66faafbfdc6d0e5763b (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
#!/bin/sh
ARGS=""
if [ "$1" == "-v" ]; then
	ARGS=$1
	shift
fi

export CVSROOT="$1"
export MODULE="$2"
if [ ! "$CVSROOT" ] || [ ! "$MODULE" ] || [ ! -d $CVSROOT ] || [ ! -d $CVSROOT/CVSROOT ] || [ ! -d $CVSROOT/$MODULE ] ; then
	echo "Usage: git cvsimport <cvsroot> <module>"
	exit 1
fi

cvsps -h 2>&1 | grep -q "cvsps version 2.1" >& /dev/null || {
	echo "I need cvsps version 2.1"
	exit 1
}

mkdir "$MODULE" || exit 1
cd "$MODULE"

TZ=UTC cvsps -A $MODULE | git-cvs2git $ARGS --cvsroot="$CVSROOT" --module="$MODULE" > .git-create-script || exit 1
sh .git-create-script