2005-06-08 00:11:28 +02:00
|
|
|
#!/bin/sh
|
2005-06-10 08:38:32 +02:00
|
|
|
|
|
|
|
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
|
2005-06-08 00:11:28 +02:00
|
|
|
shift
|
2005-06-10 08:38:32 +02:00
|
|
|
done
|
2005-06-08 00:11:28 +02:00
|
|
|
|
|
|
|
export CVSROOT="$1"
|
|
|
|
export MODULE="$2"
|
2005-06-10 08:22:06 +02:00
|
|
|
if [ ! "$CVSROOT" ] || [ ! "$MODULE" ] ; then
|
2005-06-10 08:38:32 +02:00
|
|
|
usage
|
2005-06-08 00:11:28 +02:00
|
|
|
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"
|
|
|
|
|
2005-06-10 08:38:32 +02:00
|
|
|
TZ=UTC cvsps $CVSPS $MODULE > .git-cvsps-result
|
2005-06-10 08:27:47 +02:00
|
|
|
[ -s .git-cvsps-result ] || exit 1
|
2005-06-10 08:38:32 +02:00
|
|
|
git-cvs2git $CVS2GIT --cvsroot="$CVSROOT" --module="$MODULE" < .git-cvsps-result > .git-create-script || exit 1
|
2005-06-08 00:11:28 +02:00
|
|
|
sh .git-create-script
|
|
|
|
|