Changeset 19336 for trunk/base


Ignore:
Timestamp:
Aug 30, 2006, 2:42:31 PM (18 years ago)
Author:
dluke@…
Message:

Update IndexRegen.sh to use subversion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/portmgr/IndexRegen.sh

    r15686 r19336  
    66# e-mail: jmpp@opendarwin.org
    77# Updated by Paul Guyot, <pguyot@kallisys.net>
    8 # $Id: IndexRegen.sh,v 1.3 2006/01/04 17:00:32 pguyot Exp $
     8# Updated for svn by Daniel J. Luke <dluke@geeklair.net>
     9# $Id: IndexRegen.sh,v 1.1 2005/12/06 20:47:42 jmpp Exp $
    910####
    1011
    1112# Configuration
    12 LOCKFILE=/tmp/.dp_index_regen.lock
     13LOCKFILE=/tmp/.dp_svn_index_regen.lock
    1314# ROOT directory, where everything is. This must exist.
    14 ROOT=/Users/pguyot/dp-portindex
    15 # SSH key. This must exist.
    16 SSH_KEY=${ROOT}/id_dsa
     15ROOT=/Users/dluke/Projects/dp_svn_index_regen
    1716# DP user.
    18 DP_USER=pguyot
     17DP_USER=dluke
    1918# DP group.
    20 DP_GROUP=darwinports
    21 # CVS user.
    22 CVS_USER=pguyot
     19DP_GROUP=staff
    2320# e-mail address to spam in case of failure.
    24 SPAM_LOVERS=portmgr@opendarwin.org
     21SPAM_LOVERS=portmgr@opendarwin.org,dluke@geeklair.net
    2522
    2623# Other settings (probably don't need to be changed).
    27 # CVS root.
    28 CVS_ROOT=:ext:${CVS_USER}@cvs.opendarwin.org:/Volumes/src/cvs/od
    29 #CVS_ROOT=/Volumes/src/cvs/od # <-- direct access on the same box.
    30 # CVS module.
    31 CVS_MODULE=darwinports
    32 # Wrapper. This gets created.
    33 SSH_WRAPPER=${ROOT}/ssh_wrapper
     24SVN_URL=https://svn.macosforge.org/repository/macports/trunk/
     25SVN_CONFIG_DIR=${ROOT}/svnconfig
    3426# Where to checkout the source code. This gets created.
    3527TREE=${ROOT}/source
     
    3931TCLPKG=${PREFIX}/lib/tcl
    4032# Path.
    41 PATH=${PREFIX}/bin:/bin:/usr/bin
     33PATH=${PREFIX}/bin:/bin:/usr/bin:/opt/local/bin
    4234# Log for the e-mail in case of failure.
    4335FAILURE_LOG=${ROOT}/failure.log
     
    5648fi
    5749
    58 # Create the SSH wrapper if it doesn't exist (comment this for -d /Volumes...)
    59 if [ ! -e $SSH_KEY ]; then
    60         echo "Key doesn't exist. The script is configured to find the SSH key at:"
    61         echo "${SSH_KEY}"
    62         exit 1
    63 fi
    64 
    65 # Create the SSH wrapper if it doesn't exist  (comment this for -d /Volumes...)
    66 if [ ! -x $SSH_WRAPPER ]; then
    67         echo "#!/bin/bash" > $SSH_WRAPPER && \
    68         echo "/usr/bin/ssh -i ${SSH_KEY} \$*" >> $SSH_WRAPPER && \
    69         chmod +x $SSH_WRAPPER \
    70                 || { echo "Creation of wrapper failed" ; exit 1 ; }
    71 fi
    72 
    7350# checkout if required, update otherwise.
    7451if [ ! -d ${TREE} ]; then
    75         mkdir -p ${TREE} && \
     52                { echo "SVN update failed, please check out a copy of DP into ${TREE}" >> $FAILURE_LOG ; FAILED=1 ; }
     53else
    7654        cd ${TREE} && \
    77         CVS_RSH=${SSH_WRAPPER} cvs -q -d $CVS_ROOT co darwinports > $FAILURE_LOG 2>&1 \
    78                 || { echo "CVS checkout failed" >> $FAILURE_LOG ; FAILED=1 ; }
    79 else
    80         cd ${TREE}/${CVS_MODULE} && \
    81         CVS_RSH=${SSH_WRAPPER} cvs -q update -dP > $FAILURE_LOG 2>&1 \
    82                 || { echo "CVS update failed" >> $FAILURE_LOG ; FAILED=1 ; }
     55        svn -q --non-interactive --config-dir $SVN_CONFIG_DIR update > $FAILURE_LOG 2>&1 \
     56                || { echo "SVN update failed" >> $FAILURE_LOG ; FAILED=1 ; }
    8357fi
    8458
    8559# (re)configure.
    8660if [ $FAILED -eq 0 ]; then
    87         cd ${TREE}/${CVS_MODULE}/base/ && \
     61        cd ${TREE}/base/ && \
    8862        mkdir -p ${TCLPKG} && \
    8963        ./configure \
     
    9872# (cleaning is useful because we don't want the indexing to fail because dependencies aren't properly computed).
    9973if [ $FAILED -eq 0 ]; then
    100         { cd ${TREE}/${CVS_MODULE}/base/ && \
     74        { cd ${TREE}/base/ && \
    10175        make clean > $FAILURE_LOG 2>&1 ; } \
    10276                || { echo "make clean failed" >> $FAILURE_LOG ; FAILED=1 ; }
     
    10579# (re)build
    10680if [ $FAILED -eq 0 ]; then
    107         { cd ${TREE}/${CVS_MODULE}/base/ && \
     81        { cd ${TREE}/base/ && \
    10882        make > $FAILURE_LOG 2>&1 ; } \
    10983                || { echo "make failed" >> $FAILURE_LOG ; FAILED=1 ; }
     
    11286# (re)install
    11387if [ $FAILED -eq 0 ]; then
    114         { cd ${TREE}/${CVS_MODULE}/base/ && \
     88        { cd ${TREE}/base/ && \
    11589        make install > $FAILURE_LOG 2>&1 ; } \
    11690                || { echo "make install failed" >> $FAILURE_LOG ; FAILED=1 ; }
     
    11993# (re)index
    12094if [ $FAILED -eq 0 ]; then
    121         { cd ${TREE}/${CVS_MODULE}/dports/ && \
     95        { cd ${TREE}/dports/ && \
    12296        ${PREFIX}/bin/portindex > $FAILURE_LOG 2>&1 ; } \
    12397                || { echo "portindex failed" >> $FAILURE_LOG ; FAILED=1 ; }
     
    136110       
    137111        # Actually commit the file.
    138         { cd ${TREE}/${CVS_MODULE}/dports/ && \
    139         CVS_RSH=${SSH_WRAPPER} cvs commit -F $COMMIT_MSG PortIndex > $FAILURE_LOG 2>&1 ; } \
    140                 || { echo "cvs commit failed" >> $FAILURE_LOG ; FAILED=1 ; }
     112        { cd ${TREE}/dports/ && \
     113        svn --config-dir $SVN_CONFIG_DIR commit -F $COMMIT_MSG PortIndex > $FAILURE_LOG 2>&1 ; } \
     114                || { echo "SVN commit failed" >> $FAILURE_LOG ; FAILED=1 ; }
    141115fi
    142116
Note: See TracChangeset for help on using the changeset viewer.