Skip to content
Permalink
Browse files

Update IndexRegen.sh to use subversion.

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@19336 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
danielluke committed Aug 30, 2006
1 parent ad19e74 commit f34f9ba9a1fa83147917b0ae3f245de6cfc09bb1
Showing with 22 additions and 48 deletions.
  1. +22 −48 portmgr/IndexRegen.sh
@@ -5,40 +5,32 @@
# Created by Juan Manuel Palacios,
# 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
# Where DP will install its world. This gets created.
PREFIX=${ROOT}/opt/local
# Where DP installs darwinports1.0. This gets created.
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
# Something went wrong.
@@ -55,36 +47,18 @@ else
exit 1
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} && \
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 ; }
{ echo "SVN update failed, please check out a copy of DP into ${TREE}" >> $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 ; }
cd ${TREE} && \
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 \
--prefix=${PREFIX} \
@@ -97,28 +71,28 @@ fi
# clean
# (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 ; }
fi

# (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 ; }
fi

# (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 ; }
fi

# (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 ; }
fi
@@ -135,9 +109,9 @@ if [ $FAILED -eq 0 ]; then
tail -n 5 $FAILURE_LOG > $COMMIT_MSG

# 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

# spam if something went wrong.

0 comments on commit f34f9ba

Please sign in to comment.
You can’t perform that action at this time.