Index: trunk/base/portmgr/IndexRegen.sh
===================================================================
--- trunk/base/portmgr/IndexRegen.sh	(revision 19335)
+++ trunk/base/portmgr/IndexRegen.sh	(revision 19336)
@@ -6,30 +6,22 @@
 # e-mail: jmpp@opendarwin.org
 # Updated by Paul Guyot, <pguyot@kallisys.net>
-# $Id: IndexRegen.sh,v 1.3 2006/01/04 17:00:32 pguyot Exp $
+# Updated for svn by Daniel J. Luke <dluke@geeklair.net>
+# $Id: IndexRegen.sh,v 1.1 2005/12/06 20:47:42 jmpp Exp $
 ####
 
 # Configuration
-LOCKFILE=/tmp/.dp_index_regen.lock
+LOCKFILE=/tmp/.dp_svn_index_regen.lock
 # ROOT directory, where everything is. This must exist.
-ROOT=/Users/pguyot/dp-portindex
-# SSH key. This must exist.
-SSH_KEY=${ROOT}/id_dsa
+ROOT=/Users/dluke/Projects/dp_svn_index_regen
 # DP user.
-DP_USER=pguyot
+DP_USER=dluke
 # DP group.
-DP_GROUP=darwinports
-# CVS user.
-CVS_USER=pguyot
+DP_GROUP=staff
 # e-mail address to spam in case of failure.
-SPAM_LOVERS=portmgr@opendarwin.org
+SPAM_LOVERS=portmgr@opendarwin.org,dluke@geeklair.net
 
 # Other settings (probably don't need to be changed).
-# CVS root.
-CVS_ROOT=:ext:${CVS_USER}@cvs.opendarwin.org:/Volumes/src/cvs/od
-#CVS_ROOT=/Volumes/src/cvs/od # <-- direct access on the same box.
-# CVS module.
-CVS_MODULE=darwinports
-# Wrapper. This gets created.
-SSH_WRAPPER=${ROOT}/ssh_wrapper
+SVN_URL=https://svn.macosforge.org/repository/macports/trunk/
+SVN_CONFIG_DIR=${ROOT}/svnconfig
 # Where to checkout the source code. This gets created.
 TREE=${ROOT}/source
@@ -39,5 +31,5 @@
 TCLPKG=${PREFIX}/lib/tcl
 # Path.
-PATH=${PREFIX}/bin:/bin:/usr/bin
+PATH=${PREFIX}/bin:/bin:/usr/bin:/opt/local/bin
 # Log for the e-mail in case of failure.
 FAILURE_LOG=${ROOT}/failure.log
@@ -56,34 +48,16 @@
 fi
 
-# Create the SSH wrapper if it doesn't exist (comment this for -d /Volumes...)
-if [ ! -e $SSH_KEY ]; then
-	echo "Key doesn't exist. The script is configured to find the SSH key at:"
-	echo "${SSH_KEY}"
-	exit 1
-fi
-
-# Create the SSH wrapper if it doesn't exist  (comment this for -d /Volumes...)
-if [ ! -x $SSH_WRAPPER ]; then
-	echo "#!/bin/bash" > $SSH_WRAPPER && \
-	echo "/usr/bin/ssh -i ${SSH_KEY} \$*" >> $SSH_WRAPPER && \
-	chmod +x $SSH_WRAPPER \
-		|| { echo "Creation of wrapper failed" ; exit 1 ; }
-fi
-
 # checkout if required, update otherwise.
 if [ ! -d ${TREE} ]; then
-	mkdir -p ${TREE} && \
+		{ echo "SVN update failed, please check out a copy of DP into ${TREE}" >> $FAILURE_LOG ; FAILED=1 ; }
+else
 	cd ${TREE} && \
-	CVS_RSH=${SSH_WRAPPER} cvs -q -d $CVS_ROOT co darwinports > $FAILURE_LOG 2>&1 \
-		|| { echo "CVS checkout failed" >> $FAILURE_LOG ; FAILED=1 ; }
-else
-	cd ${TREE}/${CVS_MODULE} && \
-	CVS_RSH=${SSH_WRAPPER} cvs -q update -dP > $FAILURE_LOG 2>&1 \
-		|| { echo "CVS update failed" >> $FAILURE_LOG ; FAILED=1 ; }
+	svn -q --non-interactive --config-dir $SVN_CONFIG_DIR update > $FAILURE_LOG 2>&1 \
+		|| { echo "SVN update failed" >> $FAILURE_LOG ; FAILED=1 ; }
 fi
 
 # (re)configure.
 if [ $FAILED -eq 0 ]; then
-	cd ${TREE}/${CVS_MODULE}/base/ && \
+	cd ${TREE}/base/ && \
 	mkdir -p ${TCLPKG} && \
 	./configure \
@@ -98,5 +72,5 @@
 # (cleaning is useful because we don't want the indexing to fail because dependencies aren't properly computed).
 if [ $FAILED -eq 0 ]; then
-	{ cd ${TREE}/${CVS_MODULE}/base/ && \
+	{ cd ${TREE}/base/ && \
 	make clean > $FAILURE_LOG 2>&1 ; } \
 		|| { echo "make clean failed" >> $FAILURE_LOG ; FAILED=1 ; }
@@ -105,5 +79,5 @@
 # (re)build
 if [ $FAILED -eq 0 ]; then
-	{ cd ${TREE}/${CVS_MODULE}/base/ && \
+	{ cd ${TREE}/base/ && \
 	make > $FAILURE_LOG 2>&1 ; } \
 		|| { echo "make failed" >> $FAILURE_LOG ; FAILED=1 ; }
@@ -112,5 +86,5 @@
 # (re)install
 if [ $FAILED -eq 0 ]; then
-	{ cd ${TREE}/${CVS_MODULE}/base/ && \
+	{ cd ${TREE}/base/ && \
 	make install > $FAILURE_LOG 2>&1 ; } \
 		|| { echo "make install failed" >> $FAILURE_LOG ; FAILED=1 ; }
@@ -119,5 +93,5 @@
 # (re)index
 if [ $FAILED -eq 0 ]; then
-	{ cd ${TREE}/${CVS_MODULE}/dports/ && \
+	{ cd ${TREE}/dports/ && \
 	${PREFIX}/bin/portindex > $FAILURE_LOG 2>&1 ; } \
 		|| { echo "portindex failed" >> $FAILURE_LOG ; FAILED=1 ; }
@@ -136,7 +110,7 @@
 	
 	# Actually commit the file.
-	{ cd ${TREE}/${CVS_MODULE}/dports/ && \
-	CVS_RSH=${SSH_WRAPPER} cvs commit -F $COMMIT_MSG PortIndex > $FAILURE_LOG 2>&1 ; } \
-		|| { echo "cvs commit failed" >> $FAILURE_LOG ; FAILED=1 ; }
+	{ cd ${TREE}/dports/ && \
+	svn --config-dir $SVN_CONFIG_DIR commit -F $COMMIT_MSG PortIndex > $FAILURE_LOG 2>&1 ; } \
+		|| { echo "SVN commit failed" >> $FAILURE_LOG ; FAILED=1 ; }
 fi
 
