[Fai-commit] r4567 - trunk/lib
lange at alioth.debian.org
lange at alioth.debian.org
Thu Sep 13 10:20:33 UTC 2007
Author: lange
Date: 2007-09-13 10:20:33 +0000 (Thu, 13 Sep 2007)
New Revision: 4567
Added:
trunk/lib/get-config-dir-git
Log:
access configspace with git (closes: #441992)
Added: trunk/lib/get-config-dir-git
===================================================================
--- trunk/lib/get-config-dir-git (rev 0)
+++ trunk/lib/get-config-dir-git 2007-09-13 10:20:33 UTC (rev 4567)
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# (c) 2002-2006 Henning Glawe <glaweh at debian.org>
+# (c) 2007 Holger Levsen <holger at layer-acht.org> for the modifications to use git
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:
+# Requires-Var: $FAI_CONFIG_SRC $FAI $LOGDIR
+# Suggests-Var:
+# Short-Description: get $FAI from a git repository.
+### END SUBROUTINE INFO
+
+# matched string: "git://user@host/svnpath"
+protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://')
+gitpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^[:space:]]\+\)')
+
+case $protocol in
+ git)
+ giturl="git://$gitpath"
+ ;;
+ git+http)
+ echo git+http
+ giturl="http://$gitpath"
+ ;;
+ *)
+ echo "get-config-dir-git: protocol $protocol not implemented"
+ exit 1
+ ;;
+esac
+
+if [ -d "$FAI/.git" ] ; then
+ echo "Updating git copy in $FAI"
+ cd $FAI
+ git pull
+else
+ echo "Checking out from git"
+ git clone $giturl $FAI
+fi
More information about the Fai-commit
mailing list