[Fai-commit] r4033 - trunk/lib
fai-commit at lists.alioth.debian.org
fai-commit at lists.alioth.debian.org
Tue Sep 26 19:10:13 UTC 2006
Author: lange
Date: 2006-09-26 19:10:13 +0000 (Tue, 26 Sep 2006)
New Revision: 4033
Added:
trunk/lib/get-config-dir-svn
Log:
add svn support for config space (closes: #314991)
Added: trunk/lib/get-config-dir-svn
===================================================================
--- trunk/lib/get-config-dir-svn (rev 0)
+++ trunk/lib/get-config-dir-svn 2006-09-26 19:10:13 UTC (rev 4033)
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# (c) 2002-2006 Henning Glawe <glaweh at debian.org>
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:
+# Requires-Var: $FAI_CONFIG_SRC $FAI $LOGDIR
+# Suggests-Var:
+# Short-Description: get $FAI from an svn repository.
+### END SUBROUTINE INFO
+
+# matched string: "svn://user@host/svnpath"
+protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://')
+username=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^@]*\)@')
+svnpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://[^@]\+@\(\S\+\)')
+
+case $protocol in
+ svn)
+ svnurl="svn://$svnpath"
+ ;;
+ svn+file)
+ svnurl="file://$svnpath"
+ ;;
+ svn+http)
+ svnurl="http://$svnpath"
+ ;;
+ svn+https)
+ svnurl="https://$svnpath"
+ ;;
+ *)
+ echo "get-config-dir-svn: protocol $protocol not implemented"
+ exit 1
+ ;;
+esac
+
+[ -n "$username" ] && user="--username $username"
+
+if [ -d "$FAI/.svn" ] ; then
+ echo "Updating SVN in $FAI"
+ cd $FAI
+ svn up $user | grep -v 'Updated to revision' > $LOGDIR/getconf.log
+else
+ echo "Checking out SVN"
+ svn co $user $svnurl $FAI | grep -v 'Checked out revision' > $LOGDIR/getconf.log
+fi
Property changes on: trunk/lib/get-config-dir-svn
___________________________________________________________________
Name: svn:executable
+ *
More information about the Fai-commit
mailing list