[Fai-commit] r5312 - in trunk: debian lib
Thomas Lange
lange at alioth.debian.org
Thu Apr 9 13:55:25 UTC 2009
Author: lange
Date: 2009-04-09 13:55:25 +0000 (Thu, 09 Apr 2009)
New Revision: 5312
Modified:
trunk/debian/changelog
trunk/lib/get-config-dir-svn
Log:
lib/get-config-dir-svn: Added support for password in SVN URL (thanks
Robin Powell) (closes: #515057)
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2009-04-09 13:51:19 UTC (rev 5311)
+++ trunk/debian/changelog 2009-04-09 13:55:25 UTC (rev 5312)
@@ -14,6 +14,8 @@
(thanks Alexander Fisher) (closes: #441436)
* bin/fai-setup: Do not unconditionally add $FAI_CONFIGDIR to exports(5)
(thanks Sebastian Harl) (closes: #504801)
+ * lib/get-config-dir-svn: Added support for password in SVN URL (thanks
+ Robin Powell) (closes: #515057)
[ Michael Tautschnig ]
* setup-storage: Bumped version number to 1.0.4
@@ -70,7 +72,7 @@
* bin/faimond: Try to load Proc::Daemon only in case -d is given; if it
fails, print a helpful error message (closes: #513090)
- -- Thomas Lange <lange at debian.org> Thu, 09 Apr 2009 15:49:36 +0200
+ -- Thomas Lange <lange at debian.org> Thu, 09 Apr 2009 15:55:18 +0200
(3.2.17) unstable; urgency=medium
Modified: trunk/lib/get-config-dir-svn
===================================================================
--- trunk/lib/get-config-dir-svn 2009-04-09 13:51:19 UTC (rev 5311)
+++ trunk/lib/get-config-dir-svn 2009-04-09 13:55:25 UTC (rev 5312)
@@ -11,9 +11,13 @@
# matched string: "svn://user@host/svnpath"
protocol=$(expr match "$FAI_CONFIG_SRC" '\([^:]*\)://')
-username=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^@]*\)@')
+# username may or may not be followed by a password
+username=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^@:]*\)[^@]*@')
if [ -n "$username" ] ; then
svnpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://[^@]\+@\([^[:space:]]\+\)')
+ # password definitely is preceded by a username
+ password=$(expr match "$FAI_CONFIG_SRC" '[^:]*://[^@:]*:\([^@]*\)@')
+ [ -n "$password" ] && pass="--password $password"
else
svnpath=$(expr match "$FAI_CONFIG_SRC" '[^:]*://\([^[:space:]]\+\)')
fi
@@ -49,10 +53,10 @@
if [ -d "$FAI/.svn" ] ; then
echo "Updating SVN in $FAI"
cd $FAI
- svn up $user | grep -v 'Updated to revision' > $LOGDIR/getconf.log
+ svn up $user $pass | grep -v 'Updated to revision' > $LOGDIR/getconf.log
task_error 701 $?
else
echo "Checking out SVN"
- svn co $user $svnurl $FAI | grep -v 'Checked out revision' > $LOGDIR/getconf.log
+ svn co $user $pass $svnurl $FAI | grep -v 'Checked out revision' > $LOGDIR/getconf.log
task_error 702 $?
fi
More information about the Fai-commit
mailing list