summaryrefslogtreecommitdiff
path: root/git-cvsimport-script
blob: 0ba67461da47a2fb0a0d31e955b184218734673b (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
#!/bin/sh
 
usage () {
	echo "Usage: git cvsimport [-v] [-z fuzz] <cvsroot> <module>"
	exit 1
}
 
CVS2GIT=""
CVSPS="--cvs-direct -x -A"
while true; do
	case "$1" in
	-v) CVS2GIT="$1" ;;
	-z) shift; CVSPS="$CVSPS -z $1" ;;
	-*) usage ;;
	*)  break ;;
	esac
	shift
done
 
export CVSROOT="$1"
export MODULE="$2"
if [ ! "$CVSROOT" ] || [ ! "$MODULE" ] ; then
	usage
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 $CVSPS $MODULE > .git-cvsps-result
[ -s .git-cvsps-result ] || exit 1
git-cvs2git $CVS2GIT --cvsroot="$CVSROOT" --module="$MODULE" < .git-cvsps-result > .git-create-script || exit 1
sh .git-create-script