3 # (c) 2002-2006 Henning Glawe <glaweh@debian.org>
4 # (c) 2007 Holger Levsen <holger@layer-acht.org> for the modifications to use git
6 ### BEGIN SUBROUTINE INFO
8 # Requires-Var: $FAI_CONFIG_SRC $FAI $LOGDIR
10 # Short-Description: get $FAI from a git repository.
11 ### END SUBROUTINE INFO
13 # matched string: "git://gitpath"
14 protocol
=$
(expr match
"$FAI_CONFIG_SRC" '\([^:]*\)://')
15 gitpath
=$
(expr match
"$FAI_CONFIG_SRC" '[^:]*://\([^[:space:]]\+\)')
19 giturl
="git://$gitpath"
23 giturl
="http://$gitpath"
30 echo "get-config-dir-git: protocol $protocol not implemented"
35 if [ -d "$FAI/.git" ] ; then
36 echo "Updating git copy in $FAI"
41 echo "Checking out from git"
42 # cloning into an existing directory is not allowed
43 if [ -d $FAI ]; then rmdir $FAI; fi
44 git clone
$giturl $FAI