[68639] trunk/base/portmgr/jobs

wsiegrist at apple.com wsiegrist at apple.com
Tue Jun 8 13:38:52 PDT 2010


Revision: 68639
          http://trac.macports.org/changeset/68639
Author:   wsiegrist at apple.com
Date:     2010-06-08 13:38:49 -0700 (Tue, 08 Jun 2010)
Log Message:
-----------
Unify portindex and rsync update jobs and support MacPorts v1.9.

Modified Paths:
--------------
    trunk/base/portmgr/jobs/mprsyncup

Removed Paths:
-------------
    trunk/base/portmgr/jobs/PortIndexRegen.sh

Deleted: trunk/base/portmgr/jobs/PortIndexRegen.sh
===================================================================
--- trunk/base/portmgr/jobs/PortIndexRegen.sh	2010-06-08 19:15:45 UTC (rev 68638)
+++ trunk/base/portmgr/jobs/PortIndexRegen.sh	2010-06-08 20:38:49 UTC (rev 68639)
@@ -1,121 +0,0 @@
-#!/bin/bash
-
-####
-# PortIndex regen automation script.
-# Created by Juan Manuel Palacios,
-# e-mail: jmpp at macports.org
-# Updated by Paul Guyot, <pguyot at kallisys.net>
-# Updated for svn by Daniel J. Luke <dluke at geeklair.net>
-# $Id$
-####
-
-# Configuration
-LOCKFILE=/tmp/.mp_svn_index_regen.lock
-# ROOT directory, where everything is. This needs to exist!
-ROOT=/Users/mp-user/mp_svn_index_regen
-# MP user.
-MP_USER=mp-user
-# MP group.
-MP_GROUP=mp-user
-# e-mail address to spam in case of failure.
-#SPAM_LOVERS=example at hostname.com
-
-# Other settings (probably don't need to be changed).
-SVN_CONFIG_DIR=${ROOT}/svnconfig
-REPO_BASE=http://svn.macports.org/repository/macports
-SVN="/opt/local/bin/svn -q --non-interactive --config-dir $SVN_CONFIG_DIR"
-# Where to checkout the source code. This needs to exist!
-SRCTREE=${ROOT}/source
-# Where MP will install its world. This gets created.
-PREFIX=${ROOT}/opt/local
-# Where MP installs macports1.0. This gets created.
-TCLPKG=${PREFIX}/lib/tcl
-# Path.
-PATH=${PREFIX}/bin:/bin:/usr/bin:/usr/sbin:/opt/local/bin:/usr/X11/bin
-# Log for the e-mail in case of failure.
-FAILURE_LOG=${ROOT}/failure.log
-# Commit message.
-COMMIT_MSG=${ROOT}/commit.msg
-# The date.
-DATE=$(date +'%A %Y-%m-%d at %H:%M:%S')
-
-
-# Function to spam people in charge if something goes wrong during indexing.
-bail () {
-    mail -s "PortIndex Regen failure on ${DATE}" $SPAM_LOVERS < $FAILURE_LOG
-    cleanup; exit 1
-}
-
-# Cleanup function for runtime files.
-cleanup () {
-    rm -f $COMMIT_MSG $FAILURE_LOG
-    rm -f $LOCKFILE
-}
-
-
-if [ ! -e $LOCKFILE ]; then
-    touch $LOCKFILE
-else
-    echo "PortIndex Regen lockfile found, is another regen job running?" > $FAILURE_LOG; bail
-fi
-
-# Checkout/update the ports tree
-if [ -d ${SRCTREE}/dports ]; then
-    $SVN update ${SRCTREE}/dports > $FAILURE_LOG 2>&1 \
-	|| { echo "Updating the ports tree from $REPO_BASE/trunk/dports failed." >> $FAILURE_LOG; bail ; }
-else
-    $SVN checkout ${REPO_BASE}/trunk/dports ${SRCTREE}/dports > $FAILURE_LOG 2>&1 \
-	|| { echo "Checking out the ports tree from $REPO_BASE/trunk/dports failed." >> $FAILURE_LOG ; bail ; }
-fi
-echo `date -u +%s` > ${ROOT}/PORTS-TIMESTAMP
-
-# Checkout/update HEAD
-TMPDIR=mp_trunk/base
-if [ -d ${ROOT}/${TMPDIR} ]; then
-    $SVN update ${ROOT}/${TMPDIR} > $FAILURE_LOG 2>&1 \
-	|| { echo "Updating the trunk from $REPO_BASE/trunk/base failed." >> $FAILURE_LOG; bail ; }
-else
-    $SVN checkout ${REPO_BASE}/trunk/base ${ROOT}/${TMPDIR} > $FAILURE_LOG 2>&1 \
-       || { echo "Checking out the trunk from $REPO_BASE/trunk/base failed." >> $FAILURE_LOG ; bail ; }
-fi
-
-echo `date -u +%s` > ${ROOT}/BASE-TIMESTAMP
-
-# (re)configure.
-cd ${ROOT}/${TMPDIR} && \
-    mkdir -p ${TCLPKG} && \
-    ./configure \
-    --prefix=${PREFIX} \
-    --with-tclpackage=${TCLPKG} \
-    --with-install-user=${MP_USER} \
-    --with-install-group=${MP_GROUP} > $FAILURE_LOG 2>&1 \
-    || { echo "./configure script failed." >> $FAILURE_LOG ; bail ; }
-
-# clean
-# (cleaning is useful because we don't want the indexing to fail because dependencies aren't properly computed).
-{ cd ${ROOT}/${TMPDIR} && make clean > $FAILURE_LOG 2>&1 ; } \
-    || { echo "make clean failed." >> $FAILURE_LOG ; bail ; }
-
-# (re)build
-{ cd ${ROOT}/${TMPDIR} && make > $FAILURE_LOG 2>&1 ; } \
-    || { echo "make failed." >> $FAILURE_LOG ; bail ; }
-
-# (re)install
-{ cd ${ROOT}/${TMPDIR} && make install > $FAILURE_LOG 2>&1 ; } \
-    || { echo "make install failed." >> $FAILURE_LOG ; bail ; }
-
-# (re)index
-{ cd ${SRCTREE}/dports/ && ${PREFIX}/bin/portindex > $FAILURE_LOG 2>&1 ; } \
-    || { echo "portindex failed." >> $FAILURE_LOG ; bail ; }
-
-# Commit the new index using the last 5 lines of the log for the commit message,
-tail -n 5 $FAILURE_LOG > $COMMIT_MSG
-# plus parsing failures, if any.
-echo "" >> $COMMIT_MSG
-grep Failed $FAILURE_LOG >> $COMMIT_MSG
-{ cd ${SRCTREE}/dports/ && \
-    $SVN --config-dir $SVN_CONFIG_DIR commit -F $COMMIT_MSG PortIndex PortIndex.quick > $FAILURE_LOG 2>&1 ; } \
-    || { echo "SVN commit failed." >> $FAILURE_LOG ; bail ; }
-
-# At this point the index was committed successfuly, so we cleanup before we exit.
-cleanup && exit 0

Modified: trunk/base/portmgr/jobs/mprsyncup
===================================================================
--- trunk/base/portmgr/jobs/mprsyncup	2010-06-08 19:15:45 UTC (rev 68638)
+++ trunk/base/portmgr/jobs/mprsyncup	2010-06-08 20:38:49 UTC (rev 68639)
@@ -1,6 +1,4 @@
 #!/bin/sh
-
-
 ####
 # Script to checkout/update base sources from both trunk (ToT) and the current
 # release tag (as determined by the base/config/RELEASE_URL file) and a ports
@@ -30,24 +28,39 @@
 # $Id$
 ####
 
-
 set -e
+set -x
 
 # Commands we need:
 SVN="/opt/local/bin/svn -q --non-interactive"
 CLEANUP="/opt/local/bin/svn --non-interactive cleanup"
-RSYNC="/usr/bin/rsync -q"
+RSYNC="/opt/local/bin/rsync -q"
 RM="/bin/rm"
 MKDIR="/bin/mkdir"
 LN="/bin/ln"
 
 # Paths we'll work on:
+ROOT=/var/tmp/macports
+TMPDIR=mp_trunk/base
+PREFIX=${ROOT}/opt/local
+TCLPKG=${PREFIX}/lib/tcl
 SVNROOT=/var/tmp/macports
 TBASE=${SVNROOT}/trunk/base
 RBASE=${SVNROOT}/release/base
 PORTS=${SVNROOT}/release/ports
-RSYNCROOT=/Volumes/data/rsync/macports
+RSYNCROOT=/rsync/macports
+PORTINDEX=${PREFIX}/bin/portindex
 
+PATH=${PREFIX}/bin:/bin:/usr/bin:/usr/sbin:/opt/local/bin
+
+# platforms we generate indexes for
+PLATFORMS="8_ppc 8_i386 9_ppc 9_i386 10_i386"
+# copy new index of this platform to old index location for MP v1.8 compatability
+OLD_INDEX_PLATFORM="9_i386"
+
+MP_USER=nobody
+MP_GROUP=nobody
+
 # Sources information:
 SVNURL=http://svn.macports.org/repository/macports
 RELEASE_URL_FILE=config/RELEASE_URL
@@ -64,18 +77,11 @@
     ${SVN} checkout ${SVNURL}/trunk/base ${TBASE}
 fi
 
-# Delete old exports if they exist
-if [ -d ${TBASE}-export ]; then
-    $RM -rf ${TBASE}-export;
-fi
-${SVN} export ${TBASE} ${TBASE}-export
-
 if [ ! -d ${RSYNCROOT}/trunk/base ]; then
     ${MKDIR} -p ${RSYNCROOT}/trunk
 fi
-${RSYNC} -a -I --delete ${TBASE}-export/ ${RSYNCROOT}/trunk/base && ${RM} -rf ${TBASE}-export
+${RSYNC} -aIC --delete ${TBASE}/ ${RSYNCROOT}/trunk/base
 
-
 # Read what tag we're releasing from, switch to/checkout a copy, export and rsync it to ${RSYNCROOT}/release/base:
 read RELEASE_URL < ${TBASE}/${RELEASE_URL_FILE}
 if [ ! -n ${RELEASE_URL} ]; then
@@ -88,16 +94,10 @@
     ${SVN} checkout ${RELEASE_URL} ${RBASE}
 fi
 
-# Delete old exports if they exist
-if [ -d ${RBASE}-export ]; then
-    $RM -rf ${RBASE}-export;
-fi
-${SVN} export ${RBASE} ${RBASE}-export
-
 if [ ! -d ${RSYNCROOT}/release/base ]; then
     ${MKDIR} -p ${RSYNCROOT}/release/base
 fi
-${RSYNC} -a -I --delete ${RBASE}-export/ ${RSYNCROOT}/release/base && ${RM} -rf ${RBASE}-export
+${RSYNC} -aIC --delete ${RBASE}/ ${RSYNCROOT}/release/base 
 
 # clean up the working copy if it is locked
 if [ -f ${PORTS}/.svn/lock ]; then
@@ -111,26 +111,36 @@
     ${SVN} checkout ${SVNURL}/trunk/dports ${PORTS}
 fi
 
-# Delete old exports if they exist
-if [ -d ${PORTS}-export ]; then
-    $RM -rf ${PORTS}-export;
-fi
-${SVN} export ${PORTS} ${PORTS}-export
+# generate platform-specific indexes
+pushd ${PORTS} >> /dev/null
+# build MP trunk in a private location for indexing
+pushd ${ROOT}/${TMPDIR} >> /dev/null
+mkdir -p ${TCLPKG} 
+./configure \
+    --prefix=${PREFIX} \
+    --with-tclpackage=${TCLPKG} \
+    --with-install-user=${MP_USER} \
+    --with-install-group=${MP_GROUP} 
+make clean 
+make
+make install 
+popd
 
+for PLATFORM in $PLATFORMS; do
+	$PORTINDEX -p darwin_${PLATFORM} -o PortIndex_darwin_${PLATFORM};
+done
+
+# support MP 1.8
+cp PortIndex_darwin_${OLD_INDEX_PLATFORM}/* ./
+popd
+
 if [ ! -d ${RSYNCROOT}/release/ports ]; then
     ${MKDIR} -p ${RSYNCROOT}/release/ports
 fi
-${RSYNC} -a -I --delete ${PORTS}-export/ ${RSYNCROOT}/release/ports && ${RM} -rf ${PORTS}-export
+${RSYNC} -aIC --delete ${PORTS}/ ${RSYNCROOT}/release/ports
 
-
-# Compatibility checks:
+# symlink trunk ports to release ports since we only have 1 set of ports
 cd ${RSYNCROOT}
-if [ ! -h dpupdate ]; then
-    ${RM} -rf dpupdate && ${LN} -s trunk dpupdate
-fi
-if [ ! -h dpupdate1 ]; then
-    ${RM} -rf dpupdate1 && ${LN} -s release dpupdate1
-fi
 if [ ! -h trunk/dports ]; then
     cd trunk
     ${RM} -rf dports && ${LN} -s ../release/ports dports
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100608/9429f6e3/attachment.html>


More information about the macports-changes mailing list