X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-cvsimport-script;h=0ba67461da47a2fb0a0d31e955b184218734673b;hb=180926636e47ecfe28d03cec493af75899994f0f;hp=6cd21fae1d3a0ef3b277ecc3c3ca6e602d6c488c;hpb=861cb6f02c91b66cdec572dd443ae947e795824a;p=git.git diff --git a/git-cvsimport-script b/git-cvsimport-script index 6cd21fae..0ba67461 100755 --- a/git-cvsimport-script +++ b/git-cvsimport-script @@ -1,15 +1,26 @@ #!/bin/sh -ARGS="" -if [ "$1" == "-v" ]; then - ARGS=$1 + +usage () { + echo "Usage: git cvsimport [-v] [-z fuzz] " + 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 -fi +done export CVSROOT="$1" export MODULE="$2" if [ ! "$CVSROOT" ] || [ ! "$MODULE" ] ; then - echo "Usage: git cvsimport " - exit 1 + usage fi cvsps -h 2>&1 | grep -q "cvsps version 2.1" >& /dev/null || { @@ -20,8 +31,8 @@ cvsps -h 2>&1 | grep -q "cvsps version 2.1" >& /dev/null || { mkdir "$MODULE" || exit 1 cd "$MODULE" -TZ=UTC cvsps -x -A $MODULE > .git-cvsps-result +TZ=UTC cvsps $CVSPS $MODULE > .git-cvsps-result [ -s .git-cvsps-result ] || exit 1 -git-cvs2git $ARGS --cvsroot="$CVSROOT" --module="$MODULE" < .git-cvsps-result > .git-create-script || exit 1 +git-cvs2git $CVS2GIT --cvsroot="$CVSROOT" --module="$MODULE" < .git-cvsps-result > .git-create-script || exit 1 sh .git-create-script