[Fai-commit] r5307 - in trunk: debian lib

Thomas Lange lange at alioth.debian.org
Thu Apr 9 13:09:03 UTC 2009


Author: lange
Date: 2009-04-09 13:09:02 +0000 (Thu, 09 Apr 2009)
New Revision: 5307

Modified:
   trunk/debian/changelog
   trunk/lib/get-config-dir-svn
Log:
lib/get-config-dir-svn: Make username in svn:// config url optional
(thanks Alexander Fisher) (closes: #441436)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-04-09 12:50:49 UTC (rev 5306)
+++ trunk/debian/changelog	2009-04-09 13:09:02 UTC (rev 5307)
@@ -10,7 +10,9 @@
   * fai-do-scripts: skip files with certain suffixes (closes: #500579)
   * lib/subroutines-linux: don't rely on ' as a field separator when
     parsing boot.log, use = and strip off any quotes (closes: #439250)
-
+  * lib/get-config-dir-svn: Make username in svn:// config url optional
+    (thanks Alexander Fisher) (closes: #441436)
+  
   [ Michael Tautschnig ]
   * setup-storage: Bumped version number to 1.0.4
   * setup-storage/Exec.pm: Use --timeout=10 instead of --timeout 10 to stay

Modified: trunk/lib/get-config-dir-svn
===================================================================
--- trunk/lib/get-config-dir-svn	2009-04-09 12:50:49 UTC (rev 5306)
+++ trunk/lib/get-config-dir-svn	2009-04-09 13:09:02 UTC (rev 5307)
@@ -12,7 +12,11 @@
 # matched string: "svn://user@host/svnpath"
 protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://')
 username=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^@]*\)@')
-svnpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://[^@]\+@\([^[:space:]]\+\)')
+if [ -n "$username" ] ; then
+  svnpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://[^@]\+@\([^[:space:]]\+\)')
+else
+  svnpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^[:space:]]\+\)')
+fi
 
 case $protocol in
 	svn)
@@ -28,9 +32,11 @@
 		svnurl="https://$svnpath"
 		;;
 	svn+ssh)
-		svnurl="svn+ssh://$username@$svnpath"
-		# this is a bit hackish: if $username is empty, the path gets corrected below... 
-		# explaination: svn co -username foo svn+ssh://bar doesnt work as svn co svn+ssh://foo@bar
+    if [ -n "$username" ] ; then
+		  svnurl="svn+ssh://$username@$svnpath"
+    else
+      svnurl=$FAI_CONFIG_SRC
+    fi
 		;;
 	*)
 		echo "get-config-dir-svn: protocol $protocol not implemented"
@@ -39,7 +45,6 @@
 esac
 		
 [ -n "$username" ] && user="--username $username"
-[ -z "$username" ] && svnurl=$FAI_CONFIG_SRC
 
 if [ -d "$FAI/.svn" ] ; then
    echo "Updating SVN in $FAI"




More information about the Fai-commit mailing list