Fix the short description
[gc-utils.git] / gc-update.sh
blobe15b82a5ebcba18e3cbf72360864dd38f220526d
1 #!/bin/sh
2 # Copyright (c) 2007 David Soria Parra <dsp at php dot net>
4 # Licensed under the terms of the MIT License
5 # See /usr/share/doc/gcutils/copyright
6 # or http://www.opensource.org/licenses/mit-license.php
7 VERSION="$VERSION$"
8 PROGNAME="$PROGNAME$"
10 check_git ()
13 git --version > /dev/null
15 if test $? != 0
16 then
17 echo >&2 "Git not found. It's either not installed or not in \$PATH"
18 exit 127
21 version=`git --version | grep -o "[12]\.[5-9]\.[0-9]"`
22 if test -z "$version"
23 then
24 echo "Wrong git version. $prog needs git 1.5.0 or higher, but "`git --version`" found."
25 exit 127
29 version ()
31 echo "$PROGNAME: "`basename $0`-$VERSION
34 usage ()
36 echo "Usage: "`basename $0`" [OPTIONS]"
37 echo "Options are:"
38 echo " -h show help"
39 echo " -v verbosity"
40 echo " -gn do not try to merge based on commit messages"
41 echo " -cn do not update the cvs repository"
42 echo " -V show version information"
43 echo " -ga do not fetch recent entries (newer than 10min)"
44 echo
45 exit 127
48 check_git
50 cvsupdate=t
51 recent="-a"
52 merge="-m"
53 verbose=
54 quiet="-q"
55 while test $# != 0
57 case "$1" in
58 -ga)
59 recent=
61 -gn)
62 merge=
64 -v)
65 verbose="-v"
66 quiet=""
68 -cn)
69 cvsupdate=""
71 -h)
72 usage
74 -V)
75 version
76 exit
78 -*)
79 echo >&2 "Parameter $1 is not known."
80 usage
82 esac
83 shift
84 done
87 if test ! ".cvs" -o ! -d ".cvs/CVS/"
88 then
89 echo >&2 "Cannot found .cvs directory"
90 exit 127
93 CVSROOT=`cat .cvs/CVS/Root`
94 MODULE=`cat .cvs/CVS/Repository`
96 echo "Repository: $CVSROOT"
97 echo "Module: $MODULE"
99 git-cvsimport $merge $verbose $recent -d $CVSROOT "$MODULE"
101 if test -n "$cvsupdate"
102 then
103 cd .cvs
104 cvs $quiet update
105 cd $OLDDIR