[Fai-commit] r5527 - in trunk: . debian lib

Thomas Lange lange at alioth.debian.org
Mon Sep 28 08:40:42 UTC 2009


Author: lange
Date: 2009-09-28 08:40:40 +0000 (Mon, 28 Sep 2009)
New Revision: 5527

Added:
   trunk/lib/get-config-dir-hg
Modified:
   trunk/THANKS
   trunk/debian/changelog
Log:
get-config-dir-hg: add support for mercurial (thanks to Darshaka
Pathirana for the patch)

Modified: trunk/THANKS
===================================================================
--- trunk/THANKS	2009-09-28 08:29:37 UTC (rev 5526)
+++ trunk/THANKS	2009-09-28 08:40:40 UTC (rev 5527)
@@ -36,6 +36,7 @@
 Florian Möllers		floria.moellers at jpberlin.de
 Paul Nijjar		pnijjar at utm.utoronto.ca
 Ulrike Nitzsche		U.Nitzsche at ifw-dresden.de
+Darshaka Pathirana	dpat at syn-net.org
 Raphaël Pinson		raphink at ubuntu.com
 Thomas Pöhnitzsch	thpo at foobar-cpa.de
 Robin Powell		rpowell at looksmart.net

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-09-28 08:29:37 UTC (rev 5526)
+++ trunk/debian/changelog	2009-09-28 08:40:40 UTC (rev 5527)
@@ -1,4 +1,4 @@
-fai (3.2.23~beta16) unstable; urgency=low
+fai (3.2.23~beta17) unstable; urgency=low
 
   [ Thomas Lange ]
   * subroutines-linux: fix log message
@@ -73,6 +73,8 @@
   * doc/fai-guide.txt: fai-guide now written with asciidoc
   * fai-doc.doc-base.package: update file names
   * ftar: add support for .tgz suffix
+  * get-config-dir-hg: add support for mercurial (thanks to Darshaka
+    Pathirana for the patch)
     
   [ Michael Tautschnig ]
   * setup-storage/Parser.pm: Set the boot flag on partition mounted at /, if
@@ -110,7 +112,7 @@
   [ Holger Levsen ]
   * update to standards version 3.8.2, no changes needed
  
- -- Thomas Lange <lange at debian.org>  Fri, 25 Sep 2009 15:00:00 +0200
+ -- Thomas Lange <lange at debian.org>  Mon, 28 Sep 2009 10:40:12 +0200
 
 fai (3.2.20) unstable; urgency=low
 

Added: trunk/lib/get-config-dir-hg
===================================================================
--- trunk/lib/get-config-dir-hg	                        (rev 0)
+++ trunk/lib/get-config-dir-hg	2009-09-28 08:40:40 UTC (rev 5527)
@@ -0,0 +1,40 @@
+#!/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
+# (c) 2009 Darshaka Pathirana <dpat at syn-net.org> for the modifications to use hg
+
+### BEGIN SUBROUTINE INFO
+# Provides-Var:
+# Requires-Var:    $FAI_CONFIG_SRC $FAI $LOGDIR
+# Suggests-Var:
+# Short-Description: get $FAI from a mercurial (hg) repository.
+### END SUBROUTINE INFO
+
+# matched string: "hg://hgpath"
+protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://')
+hgpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^[:space:]]\+\)')
+
+case $protocol in
+ 	hg+http)
+ 		echo hg+http
+ 		hgurl="http://$hgpath"
+ 		;;
+	*)
+		echo "get-config-dir-hg: protocol $protocol not implemented"
+		exit 1
+		;;
+esac
+		
+if [ -d "$FAI/.hg" ] ; then
+   echo "Updating hg copy in $FAI"
+   cd $FAI
+   hg pull
+   task_error 701 $?
+else 
+   echo "Checking out from hg"
+   # cloning into an existing directory is not allowed
+   if [ -d $FAI ]; then rmdir $FAI; fi
+   hg clone $hgurl $FAI 
+   task_error 702 $?
+fi




More information about the Fai-commit mailing list