[30447] trunk/base/portmgr

source_changes at macosforge.org source_changes at macosforge.org
Sat Oct 27 22:58:32 PDT 2007


Revision: 30447
          http://trac.macosforge.org/projects/macports/changeset/30447
Author:   jmpp at macports.org
Date:     2007-10-27 22:58:31 -0700 (Sat, 27 Oct 2007)

Log Message:
-----------

Move all server side jobs to a new portmgr/jobs dir, in order to keep easier track of what we need to setup to have all our services running.
Add placeholder launchd plists for those jobs that don't already have an uploaded one (all but PortIndex2MySQL); I hope to fill these with
the appropriate information as I gather it.

PS: James, do you want me to move autosubmit in here too?

Added Paths:
-----------
    trunk/base/portmgr/jobs/
    trunk/base/portmgr/jobs/GuideRegen.sh
    trunk/base/portmgr/jobs/Makefile
    trunk/base/portmgr/jobs/PortIndex2MySQL.tcl
    trunk/base/portmgr/jobs/PortIndexRegen.sh
    trunk/base/portmgr/jobs/mprsyncup
    trunk/base/portmgr/jobs/org.macports.GuideRegen.plist
    trunk/base/portmgr/jobs/org.macports.PortIndex2MySQL.plist
    trunk/base/portmgr/jobs/org.macports.PortIndexRegen.plist
    trunk/base/portmgr/jobs/org.macports.mprsyncup.plist

Removed Paths:
-------------
    trunk/base/portmgr/GuideRegen.sh
    trunk/base/portmgr/Makefile
    trunk/base/portmgr/PortIndex2MySQL.tcl
    trunk/base/portmgr/PortIndexRegen.sh
    trunk/base/portmgr/mprsyncup
    trunk/base/portmgr/org.macports.PortIndex2MySQL.plist

Deleted: trunk/base/portmgr/GuideRegen.sh
===================================================================
--- trunk/base/portmgr/GuideRegen.sh	2007-10-28 05:43:42 UTC (rev 30446)
+++ trunk/base/portmgr/GuideRegen.sh	2007-10-28 05:58:31 UTC (rev 30447)
@@ -1,71 +0,0 @@
-#!/bin/bash
-
-####
-# Guide regen automation script.
-# Created by Daniel J. Luke
-# e-mail: dluke at geeklair.net
-# Based on IndexRegen.sh
-# $Id$
-####
-
-# Configuration
-LOCKFILE=/tmp/.mp_svn_guide_regen.lock
-# ROOT directory, where everything is. This needs to exist!
-ROOT=/Users/mp-user/mp_svn_guide_regen
-# MP user.
-MP_USER=mp-user
-# MP group.
-MP_GROUP=mp-user
-# e-mail address to spam in case of failure.
-SPAM_LOVERS=macports-dev at lists.macosforge.org,dluke at geeklair.net,markd at macports.org
-
-# 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=/opt/local
-# Path.
-PATH=${PREFIX}/bin:/bin:/usr/bin:/usr/sbin:/opt/local/bin
-# Log for the e-mail in case of failure.
-FAILURE_LOG=${ROOT}/guide_failure.log
-# The date.
-DATE=$(date +'%A %Y-%m-%d at %H:%M:%S')
-
-
-# Function to spam people in charge if something goes wrong during guide regen.
-bail () {
-    mail -s "Guide Regen Failure on ${DATE}" $SPAM_LOVERS < $FAILURE_LOG
-    cleanup; exit 1
-}
-
-# Cleanup fuction for runtime files.
-cleanup () {
-    rm -f $FAILURE_LOG $LOCKFILE
-}
-
-
-if [ ! -e $LOCKFILE ]; then
-    touch $LOCKFILE
-else
-    echo "Guide Regen lockfile found, is another regen job running?"
-    exit 1
-fi
-
-# Checkout/update the doc tree
-if [ -d ${SRCTREE}/doc-new ]; then
-    $SVN update ${SRCTREE}/doc-new > $FAILURE_LOG 2>&1 \
-        || { echo "Updating the doc tree from $REPO_BASE/trunk/doc-new failed." >> $FAILURE_LOG; bail ; }
-else
-    $SVN checkout ${REPO_BASE}/trunk/doc-new ${SRCTREE}/doc-new > $FAILURE_LOG 2>&1 \
-        || { echo "Checking out the doc tree from $REPO_BASE/trunk/doc-new failed." >> $FAILURE_LOG; bail ; }
-fi
-
-# (re)build
-{ cd ${SRCTREE}/doc-new && make guide > $FAILURE_LOG 2>&1 ; } \
-    || { echo "make failed." >> $FAILURE_LOG ; bail ; }
-
-# At this point the guide was regen'd successfuly, so we cleanup before we exit.
-cleanup && exit 0

Deleted: trunk/base/portmgr/Makefile
===================================================================
--- trunk/base/portmgr/Makefile	2007-10-28 05:43:42 UTC (rev 30446)
+++ trunk/base/portmgr/Makefile	2007-10-28 05:58:31 UTC (rev 30447)
@@ -1,20 +0,0 @@
-# $Id$
-
-SCRIPTS=	PortIndex2MySQL
-
-edit = sed \
-	-e 's, at TCL_PACKAGE_DIR@,$(TCL_PACKAGE_DIR),g'
-
-
-include ../Mk/macports.autoconf.mk
-
-
-all: ${SCRIPTS}
-
-PortIndex2MySQL: PortIndex2MySQL.tcl
-	${edit} $< > $@
-
-clean:
-	rm -f ${SCRIPTS}
-
-distclean: clean

Deleted: trunk/base/portmgr/PortIndex2MySQL.tcl
===================================================================
--- trunk/base/portmgr/PortIndex2MySQL.tcl	2007-10-28 05:43:42 UTC (rev 30446)
+++ trunk/base/portmgr/PortIndex2MySQL.tcl	2007-10-28 05:58:31 UTC (rev 30447)
@@ -1,358 +0,0 @@
-#!/usr/bin/env tclsh
-# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
-#
-# PortIndex2MySQL.tcl
-# Kevin Van Vechten | kevin at opendarwin.org
-# 3-Oct-2002
-# Juan Manuel Palacios | jmpp at macports.org
-# 30-Jul-2007
-# $Id$
-#
-# Copyright (c) 2007 Juan Manuel Palacios, MacPorts Team.
-# Copyright (c) 2003 Apple Computer, Inc.
-# Copyright (c) 2002 Kevin Van Vechten. 
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-#####
-# The PortIndex2MySQL script populates a database with key information extracted
-# from the Portfiles in the ports tree pointed to by the sources.conf file in a
-# MacPorts installation, found by loading its macports1.0 tcl package and initializing
-# it with 'mportinit' below. Main use of the resulting database is providing live
-# information to the ports.php page, a client tailored to poll it. For this very reason,
-# information fed to the database always has to be kept up to date in order to remain
-# meaningful, which is accomplished simply by calling 'macports::selfupdate' (which
-# updates the ports tree in use) and by installing the script on cron/launchd to be run
-# on a timely schedule (not any more frequent than the run of the mprsyncup script on
-# the MacPorts server, which is every half hour).
-#
-# Remaining requirement to successfully run this script is performing the necessary
-# MySQL admin tasks on the host box to create the database in the first place and the
-# MySQL user that will be given enough privileges to alter it. Values in the database
-# related variables provided below have to be adapted accordingly to match the chosen
-# setup.
-#####
-
-
-# Load macports1.0 so that we can use some of its procs and the portinfo array.
-catch {source \
-    [file join "@TCL_PACKAGE_DIR@" macports1.0 macports_fastload.tcl]}
-package require macports
-
-
-# Runtime information log file and reciepient.
-set runlog "/tmp/portsdb.log"
-set runlog_fd [open $runlog w+]
-set lockfile "/tmp/portsdb.lock"
-set mailprog "/usr/sbin/sendmail"
-set DATE [clock format [clock seconds] -format "%A %Y-%m-%d at %T"]
-set subject "PortIndex2MySQL run failure on $DATE"
-set SPAM_LOVERS macports-dev at lists.macosforge.org
-
-# House keeping on exit.
-proc cleanup {args} {
-    foreach file_to_clean $args {
-        upvar $file_to_clean up_file_to_clean
-        upvar ${file_to_clean}_fd up_file_to_clean_fd
-        close $up_file_to_clean_fd
-        file delete -force $up_file_to_clean
-    }
-}
-
-# What to do when terminating execution, depending on the $exit_status condition.
-proc terminate {exit_status} {
-    global runlog runlog_fd
-    if {$exit_status} {
-        global subject SPAM_LOVERS mailprog
-        seek $runlog_fd 0 start
-        exec -- $mailprog $SPAM_LOVERS <@ $runlog_fd
-    }
-    cleanup runlog
-    exit $exit_status
-}
-
-
-# UI instantiation to route information/error messages wherever we want.
-proc ui_channels {priority} {
-    global runlog_fd
-    switch $priority {
-        debug {
-            if {[macports::ui_isset ports_debug]} {
-                return $runlog_fd
-            } else {
-                return {}
-            }
-        }
-        info {
-            if {[macports::ui_isset ports_verbose]} {
-                return $runlog_fd
-            } else {
-                return {}
-            }
-        }
-        msg {
-            if {[macports::ui_isset ports_quiet]} {
-                return $runlog_fd
-            } else {
-                return {}
-            }
-        }
-        error {
-            return $runlog_fd
-        }
-        default {
-            return {}
-        }
-    }
-}
-
-
-# We first initialize the runlog with a proper mail subject:
-puts $runlog_fd "Subject: $subject"
-
-# Check if there are any stray sibling jobs before moving on, bail in such case.
-if {[file exists $lockfile]} {
-    ui_error "PortIndex2MySQL lock file found, is another job running?"
-    terminate 1
-} else {
-    set lockfile_fd [open $lockfile a]
-}
-
-
-# Initialize macports1.0 and its UI, in order to find the sources.conf file
-# (which is what will point us to the PortIndex we're gonna use) and use
-# the runtime information.
-array set ui_options {ports_verbose yes}
-if {[catch {mportinit ui_options} errstr]} {
-    ui_error "${::errorInfo}"
-    ui_error "Failed to initialize MacPorts, $errstr"
-    cleanup lockfile
-    terminate 1
-}
-
-# Call the selfupdate procedure to make sure the MacPorts installation
-# is up-to-date and with a fresh ports tree.
-if {[catch {macports::selfupdate} errstr]} {
-    ui_error "${::errorInfo}"
-    ui_error "Failed to update the ports tree, $errstr"
-    cleanup lockfile
-    terminate 1
-}
-
-
-# Procedure to catch the database password from a protected file.
-proc getpasswd {passwdfile} {
-    if {[catch {open $passwdfile r} passwdfile_fd]} {
-        global lockfile lockfile_fd
-        ui_error "${::errorCode}: $passwdfile_fd"
-        cleanup lockfile
-        terminate 1
-    }
-    if {[gets $passwdfile_fd passwd] <= 0} {
-        global lockfile lockfile_fd
-        close $passwdfile_fd
-        ui_error "No password found in password file $passwdfile!"
-        cleanup lockfile
-        terminate 1
-    }
-    close $passwdfile_fd
-    return $passwd
-}
-
-# Database abstraction variables:
-set sqlfile "/tmp/portsdb.sql"
-set dbcmd [macports::findBinary mysql5]
-set dbhost 127.0.0.1
-set dbuser macports
-set passwdfile "./password_file"
-set dbpasswd [getpasswd $passwdfile]
-set dbname macports
-
-
-# Flat text file to which sql statements are written.
-if {[catch {open $sqlfile w+} sqlfile_fd]} {
-    ui_error "${::errorCode}: $sqlfile_fd"
-    cleanup lockfile
-    terminate 1
-}
-
-# SQL string escaping.
-proc sql_escape {str} {
-    regsub -all -- {'} $str {\\'} str
-    regsub -all -- {"} $str {\\"} str
-    regsub -all -- {\n} $str {\\n} str
-    return $str
-}
-
-# Initial creation of database tables: log, portfiles, categories, maintainers, dependencies, variants and platforms.
-# Do we need any other?
-puts $sqlfile_fd "DROP TABLE IF EXISTS log;"
-puts $sqlfile_fd "CREATE TABLE IF NOT EXISTS log (activity VARCHAR(255), activity_time TIMESTAMP(14));"
-puts $sqlfile_fd "INSERT INTO log VALUES ('update', NOW());"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS portfiles;"
-puts $sqlfile_fd "CREATE TABLE portfiles (name VARCHAR(255) PRIMARY KEY NOT NULL, path VARCHAR(255), version VARCHAR(255),  description TEXT);"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS categories;"
-puts $sqlfile_fd "CREATE TABLE categories (portfile VARCHAR(255), category VARCHAR(255), is_primary INTEGER);"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS maintainers;"
-puts $sqlfile_fd "CREATE TABLE maintainers (portfile VARCHAR(255), maintainer VARCHAR(255), is_primary INTEGER);"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS dependencies;"
-puts $sqlfile_fd "CREATE TABLE dependencies (portfile VARCHAR(255), library VARCHAR(255));"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS variants;"
-puts $sqlfile_fd "CREATE TABLE variants (portfile VARCHAR(255), variant VARCHAR(255));"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS platforms;"
-puts $sqlfile_fd "CREATE TABLE platforms (portfile VARCHAR(255), platform VARCHAR(255));"
-
-
-# Load every port in the index through a search that matches everything.
-if {[catch {set ports [mportsearch ".+"]} errstr]} {
-    ui_error "${::errorInfo}"
-    ui_error "port search failed: $errstr"
-    cleanup sqlfile lockfile
-    terminate 1
-}
-
-# Iterate over each matching port, extracting its information from the
-# portinfo array.
-foreach {name array} $ports {
-
-    array unset portinfo
-    array set portinfo $array
-
-    set portname [sql_escape $portinfo(name)]
-    if {[info exists portinfo(version)]} {
-        set portversion [sql_escape $portinfo(version)]
-    } else {
-        set portversion ""
-    }
-    set portdir [sql_escape $portinfo(portdir)]
-    if {[info exists portinfo(description)]} {
-        set description [sql_escape $portinfo(description)]
-    } else {
-        set description ""
-    }
-    if {[info exists portinfo(categories)]} {
-        set categories $portinfo(categories)
-    } else {
-        set categories ""
-    }
-    if {[info exists portinfo(maintainers)]} {
-        set maintainers $portinfo(maintainers)
-    } else {
-        set maintainers ""
-    }
-    if {[info exists portinfo(variants)]} {
-        set variants $portinfo(variants)
-    } else {
-        set variants ""
-    }
-    if {[info exists portinfo(depends_build)]} {
-        set depends_build $portinfo(depends_build)
-    } else {
-        set depends_build ""
-    }
-    if {[info exists portinfo(depends_lib)]} {
-        set depends_lib $portinfo(depends_lib)
-    } else {
-        set depends_lib ""
-    }
-    if {[info exists portinfo(depends_run)]} {
-        set depends_run $portinfo(depends_run)
-    } else {
-        set depends_run ""
-    }
-    if {[info exists portinfo(platforms)]} {
-        set platforms $portinfo(platforms)
-    } else {
-        set platforms ""
-    }
-
-    puts $sqlfile_fd "INSERT INTO portfiles VALUES ('$portname', '$portdir', '$portversion', '$description');"
-
-    set primary 1
-    foreach category $categories {
-        set category [sql_escape $category]
-        puts $sqlfile_fd "INSERT INTO categories VALUES ('$portname', '$category', $primary);"
-        incr primary
-    }
-    
-    set primary 1
-    foreach maintainer $maintainers {
-        set maintainer [sql_escape $maintainer]
-        puts $sqlfile_fd "INSERT INTO maintainers VALUES ('$portname', '$maintainer', $primary);"
-        incr primary
-    }
-
-    foreach build_dep $depends_build {
-        set build_dep [sql_escape $build_dep]
-        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$build_dep');"
-    }
-
-    foreach lib $depends_lib {
-        set lib [sql_escape $lib]
-        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$lib');"
-    }
-
-    foreach run_dep $depends_run {
-        set run_dep [sql_escape $run_dep]
-        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$run_dep');"
-    }
-
-    foreach variant $variants {
-        set variant [sql_escape $variant]
-        puts $sqlfile_fd "INSERT INTO variants VALUES ('$portname', '$variant');"
-    }
-
-    foreach platform $platforms {
-        set platform [sql_escape $platform]
-        puts $sqlfile_fd "INSERT INTO platforms VALUES ('$portname', '$platform');"
-    }
-
-}
-
-
-# Pipe the contents of the generated sql file to the database command,
-# reading from the file descriptor for the raw sql file to assure completeness.
-if {[catch {seek $sqlfile_fd 0 start} errstr]} {
-    ui_error "${::errorCode}: $errstr"
-    cleanup sqlfile lockfile
-    terminate 1
-}
-if {[catch {exec -- $dbcmd --host=$dbhost --user=$dbuser --password=$dbpasswd --database=$dbname <@ $sqlfile_fd} errstr]} {
-    ui_error "${::errorCode}: $errstr"
-    cleanup sqlfile lockfile
-    terminate 1
-}
-
-
-# And we're done regen'ing the MacPorts dabase! Cleanup and exit successfully.
-cleanup sqlfile lockfile
-terminate 0

Deleted: trunk/base/portmgr/PortIndexRegen.sh
===================================================================
--- trunk/base/portmgr/PortIndexRegen.sh	2007-10-28 05:43:42 UTC (rev 30446)
+++ trunk/base/portmgr/PortIndexRegen.sh	2007-10-28 05:58:31 UTC (rev 30447)
@@ -1,135 +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=macports-dev at lists.macosforge.org,dluke at geeklair.net
-
-# Other settings (probably don't need to be changed).
-SVN_CONFIG_DIR=${ROOT}/svnconfig
-REPO_BASE=http://svn.macports.org/repository/macports
-RELEASE_URL_FILE="config/RELEASE_URL"
-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
-# 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 fuction 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?"
-    exit 1
-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
-
-# Extract the release URL from HEAD
-read RELEASE_URL < ${ROOT}/${TMPDIR}/${RELEASE_URL_FILE}
-[ -n ${RELEASE_URL} ] || { echo "no RELEASE_URL specified in svn HEAD." >> $FAILURE_LOG; bail ; }
-
-# Checkout/update the release base
-if [ -d ${SRCTREE}/base ]; then
-    $SVN switch ${RELEASE_URL} ${SRCTREE}/base > $FAILURE_LOG 2>&1 \
-	|| { echo "Updating base from ${RELEASE_URL} failed." >> $FAILURE_LOG; bail ; }
-else
-    $SVN checkout ${RELEASE_URL} ${SRCTREE}/base > $FAILURE_LOG 2>&1 \
-	|| { echo "Checking out base from ${RELEASE_URL} failed." >> $FAILURE_LOG ; bail ; }
-fi
-echo `date -u +%s` > ${ROOT}/BASE-TIMESTAMP
-
-# (re)configure.
-cd ${SRCTREE}/base/ && \
-    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 ${SRCTREE}/base/ && make clean > $FAILURE_LOG 2>&1 ; } \
-    || { echo "make clean failed." >> $FAILURE_LOG ; bail ; }
-
-# (re)build
-{ cd ${SRCTREE}/base/ && make > $FAILURE_LOG 2>&1 ; } \
-    || { echo "make failed." >> $FAILURE_LOG ; bail ; }
-
-# (re)install
-{ cd ${SRCTREE}/base/ && 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 > $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

Copied: trunk/base/portmgr/jobs/GuideRegen.sh (from rev 30436, trunk/base/portmgr/GuideRegen.sh)
===================================================================
--- trunk/base/portmgr/jobs/GuideRegen.sh	                        (rev 0)
+++ trunk/base/portmgr/jobs/GuideRegen.sh	2007-10-28 05:58:31 UTC (rev 30447)
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+####
+# Guide regen automation script.
+# Created by Daniel J. Luke
+# e-mail: dluke at geeklair.net
+# Based on IndexRegen.sh
+# $Id$
+####
+
+# Configuration
+LOCKFILE=/tmp/.mp_svn_guide_regen.lock
+# ROOT directory, where everything is. This needs to exist!
+ROOT=/Users/mp-user/mp_svn_guide_regen
+# MP user.
+MP_USER=mp-user
+# MP group.
+MP_GROUP=mp-user
+# e-mail address to spam in case of failure.
+SPAM_LOVERS=macports-dev at lists.macosforge.org,dluke at geeklair.net,markd at macports.org
+
+# 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=/opt/local
+# Path.
+PATH=${PREFIX}/bin:/bin:/usr/bin:/usr/sbin:/opt/local/bin
+# Log for the e-mail in case of failure.
+FAILURE_LOG=${ROOT}/guide_failure.log
+# The date.
+DATE=$(date +'%A %Y-%m-%d at %H:%M:%S')
+
+
+# Function to spam people in charge if something goes wrong during guide regen.
+bail () {
+    mail -s "Guide Regen Failure on ${DATE}" $SPAM_LOVERS < $FAILURE_LOG
+    cleanup; exit 1
+}
+
+# Cleanup fuction for runtime files.
+cleanup () {
+    rm -f $FAILURE_LOG $LOCKFILE
+}
+
+
+if [ ! -e $LOCKFILE ]; then
+    touch $LOCKFILE
+else
+    echo "Guide Regen lockfile found, is another regen job running?"
+    exit 1
+fi
+
+# Checkout/update the doc tree
+if [ -d ${SRCTREE}/doc-new ]; then
+    $SVN update ${SRCTREE}/doc-new > $FAILURE_LOG 2>&1 \
+        || { echo "Updating the doc tree from $REPO_BASE/trunk/doc-new failed." >> $FAILURE_LOG; bail ; }
+else
+    $SVN checkout ${REPO_BASE}/trunk/doc-new ${SRCTREE}/doc-new > $FAILURE_LOG 2>&1 \
+        || { echo "Checking out the doc tree from $REPO_BASE/trunk/doc-new failed." >> $FAILURE_LOG; bail ; }
+fi
+
+# (re)build
+{ cd ${SRCTREE}/doc-new && make guide > $FAILURE_LOG 2>&1 ; } \
+    || { echo "make failed." >> $FAILURE_LOG ; bail ; }
+
+# At this point the guide was regen'd successfuly, so we cleanup before we exit.
+cleanup && exit 0

Copied: trunk/base/portmgr/jobs/Makefile (from rev 30436, trunk/base/portmgr/Makefile)
===================================================================
--- trunk/base/portmgr/jobs/Makefile	                        (rev 0)
+++ trunk/base/portmgr/jobs/Makefile	2007-10-28 05:58:31 UTC (rev 30447)
@@ -0,0 +1,20 @@
+# $Id$
+
+SCRIPTS=	PortIndex2MySQL
+
+edit = sed \
+	-e 's, at TCL_PACKAGE_DIR@,$(TCL_PACKAGE_DIR),g'
+
+
+include ../../Mk/macports.autoconf.mk
+
+
+all: ${SCRIPTS}
+
+PortIndex2MySQL: PortIndex2MySQL.tcl
+	${edit} $< > $@
+
+clean:
+	rm -f ${SCRIPTS}
+
+distclean: clean

Copied: trunk/base/portmgr/jobs/PortIndex2MySQL.tcl (from rev 30436, trunk/base/portmgr/PortIndex2MySQL.tcl)
===================================================================
--- trunk/base/portmgr/jobs/PortIndex2MySQL.tcl	                        (rev 0)
+++ trunk/base/portmgr/jobs/PortIndex2MySQL.tcl	2007-10-28 05:58:31 UTC (rev 30447)
@@ -0,0 +1,358 @@
+#!/usr/bin/env tclsh
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
+#
+# PortIndex2MySQL.tcl
+# Kevin Van Vechten | kevin at opendarwin.org
+# 3-Oct-2002
+# Juan Manuel Palacios | jmpp at macports.org
+# 30-Jul-2007
+# $Id$
+#
+# Copyright (c) 2007 Juan Manuel Palacios, MacPorts Team.
+# Copyright (c) 2003 Apple Computer, Inc.
+# Copyright (c) 2002 Kevin Van Vechten. 
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+#####
+# The PortIndex2MySQL script populates a database with key information extracted
+# from the Portfiles in the ports tree pointed to by the sources.conf file in a
+# MacPorts installation, found by loading its macports1.0 tcl package and initializing
+# it with 'mportinit' below. Main use of the resulting database is providing live
+# information to the ports.php page, a client tailored to poll it. For this very reason,
+# information fed to the database always has to be kept up to date in order to remain
+# meaningful, which is accomplished simply by calling 'macports::selfupdate' (which
+# updates the ports tree in use) and by installing the script on cron/launchd to be run
+# on a timely schedule (not any more frequent than the run of the mprsyncup script on
+# the MacPorts server, which is every half hour).
+#
+# Remaining requirement to successfully run this script is performing the necessary
+# MySQL admin tasks on the host box to create the database in the first place and the
+# MySQL user that will be given enough privileges to alter it. Values in the database
+# related variables provided below have to be adapted accordingly to match the chosen
+# setup.
+#####
+
+
+# Load macports1.0 so that we can use some of its procs and the portinfo array.
+catch {source \
+    [file join "@TCL_PACKAGE_DIR@" macports1.0 macports_fastload.tcl]}
+package require macports
+
+
+# Runtime information log file and reciepient.
+set runlog "/tmp/portsdb.log"
+set runlog_fd [open $runlog w+]
+set lockfile "/tmp/portsdb.lock"
+set mailprog "/usr/sbin/sendmail"
+set DATE [clock format [clock seconds] -format "%A %Y-%m-%d at %T"]
+set subject "PortIndex2MySQL run failure on $DATE"
+set SPAM_LOVERS macports-dev at lists.macosforge.org
+
+# House keeping on exit.
+proc cleanup {args} {
+    foreach file_to_clean $args {
+        upvar $file_to_clean up_file_to_clean
+        upvar ${file_to_clean}_fd up_file_to_clean_fd
+        close $up_file_to_clean_fd
+        file delete -force $up_file_to_clean
+    }
+}
+
+# What to do when terminating execution, depending on the $exit_status condition.
+proc terminate {exit_status} {
+    global runlog runlog_fd
+    if {$exit_status} {
+        global subject SPAM_LOVERS mailprog
+        seek $runlog_fd 0 start
+        exec -- $mailprog $SPAM_LOVERS <@ $runlog_fd
+    }
+    cleanup runlog
+    exit $exit_status
+}
+
+
+# UI instantiation to route information/error messages wherever we want.
+proc ui_channels {priority} {
+    global runlog_fd
+    switch $priority {
+        debug {
+            if {[macports::ui_isset ports_debug]} {
+                return $runlog_fd
+            } else {
+                return {}
+            }
+        }
+        info {
+            if {[macports::ui_isset ports_verbose]} {
+                return $runlog_fd
+            } else {
+                return {}
+            }
+        }
+        msg {
+            if {[macports::ui_isset ports_quiet]} {
+                return $runlog_fd
+            } else {
+                return {}
+            }
+        }
+        error {
+            return $runlog_fd
+        }
+        default {
+            return {}
+        }
+    }
+}
+
+
+# We first initialize the runlog with a proper mail subject:
+puts $runlog_fd "Subject: $subject"
+
+# Check if there are any stray sibling jobs before moving on, bail in such case.
+if {[file exists $lockfile]} {
+    ui_error "PortIndex2MySQL lock file found, is another job running?"
+    terminate 1
+} else {
+    set lockfile_fd [open $lockfile a]
+}
+
+
+# Initialize macports1.0 and its UI, in order to find the sources.conf file
+# (which is what will point us to the PortIndex we're gonna use) and use
+# the runtime information.
+array set ui_options {ports_verbose yes}
+if {[catch {mportinit ui_options} errstr]} {
+    ui_error "${::errorInfo}"
+    ui_error "Failed to initialize MacPorts, $errstr"
+    cleanup lockfile
+    terminate 1
+}
+
+# Call the selfupdate procedure to make sure the MacPorts installation
+# is up-to-date and with a fresh ports tree.
+if {[catch {macports::selfupdate} errstr]} {
+    ui_error "${::errorInfo}"
+    ui_error "Failed to update the ports tree, $errstr"
+    cleanup lockfile
+    terminate 1
+}
+
+
+# Procedure to catch the database password from a protected file.
+proc getpasswd {passwdfile} {
+    if {[catch {open $passwdfile r} passwdfile_fd]} {
+        global lockfile lockfile_fd
+        ui_error "${::errorCode}: $passwdfile_fd"
+        cleanup lockfile
+        terminate 1
+    }
+    if {[gets $passwdfile_fd passwd] <= 0} {
+        global lockfile lockfile_fd
+        close $passwdfile_fd
+        ui_error "No password found in password file $passwdfile!"
+        cleanup lockfile
+        terminate 1
+    }
+    close $passwdfile_fd
+    return $passwd
+}
+
+# Database abstraction variables:
+set sqlfile "/tmp/portsdb.sql"
+set dbcmd [macports::findBinary mysql5]
+set dbhost 127.0.0.1
+set dbuser macports
+set passwdfile "./password_file"
+set dbpasswd [getpasswd $passwdfile]
+set dbname macports
+
+
+# Flat text file to which sql statements are written.
+if {[catch {open $sqlfile w+} sqlfile_fd]} {
+    ui_error "${::errorCode}: $sqlfile_fd"
+    cleanup lockfile
+    terminate 1
+}
+
+# SQL string escaping.
+proc sql_escape {str} {
+    regsub -all -- {'} $str {\\'} str
+    regsub -all -- {"} $str {\\"} str
+    regsub -all -- {\n} $str {\\n} str
+    return $str
+}
+
+# Initial creation of database tables: log, portfiles, categories, maintainers, dependencies, variants and platforms.
+# Do we need any other?
+puts $sqlfile_fd "DROP TABLE IF EXISTS log;"
+puts $sqlfile_fd "CREATE TABLE IF NOT EXISTS log (activity VARCHAR(255), activity_time TIMESTAMP(14));"
+puts $sqlfile_fd "INSERT INTO log VALUES ('update', NOW());"
+
+puts $sqlfile_fd "DROP TABLE IF EXISTS portfiles;"
+puts $sqlfile_fd "CREATE TABLE portfiles (name VARCHAR(255) PRIMARY KEY NOT NULL, path VARCHAR(255), version VARCHAR(255),  description TEXT);"
+
+puts $sqlfile_fd "DROP TABLE IF EXISTS categories;"
+puts $sqlfile_fd "CREATE TABLE categories (portfile VARCHAR(255), category VARCHAR(255), is_primary INTEGER);"
+
+puts $sqlfile_fd "DROP TABLE IF EXISTS maintainers;"
+puts $sqlfile_fd "CREATE TABLE maintainers (portfile VARCHAR(255), maintainer VARCHAR(255), is_primary INTEGER);"
+
+puts $sqlfile_fd "DROP TABLE IF EXISTS dependencies;"
+puts $sqlfile_fd "CREATE TABLE dependencies (portfile VARCHAR(255), library VARCHAR(255));"
+
+puts $sqlfile_fd "DROP TABLE IF EXISTS variants;"
+puts $sqlfile_fd "CREATE TABLE variants (portfile VARCHAR(255), variant VARCHAR(255));"
+
+puts $sqlfile_fd "DROP TABLE IF EXISTS platforms;"
+puts $sqlfile_fd "CREATE TABLE platforms (portfile VARCHAR(255), platform VARCHAR(255));"
+
+
+# Load every port in the index through a search that matches everything.
+if {[catch {set ports [mportsearch ".+"]} errstr]} {
+    ui_error "${::errorInfo}"
+    ui_error "port search failed: $errstr"
+    cleanup sqlfile lockfile
+    terminate 1
+}
+
+# Iterate over each matching port, extracting its information from the
+# portinfo array.
+foreach {name array} $ports {
+
+    array unset portinfo
+    array set portinfo $array
+
+    set portname [sql_escape $portinfo(name)]
+    if {[info exists portinfo(version)]} {
+        set portversion [sql_escape $portinfo(version)]
+    } else {
+        set portversion ""
+    }
+    set portdir [sql_escape $portinfo(portdir)]
+    if {[info exists portinfo(description)]} {
+        set description [sql_escape $portinfo(description)]
+    } else {
+        set description ""
+    }
+    if {[info exists portinfo(categories)]} {
+        set categories $portinfo(categories)
+    } else {
+        set categories ""
+    }
+    if {[info exists portinfo(maintainers)]} {
+        set maintainers $portinfo(maintainers)
+    } else {
+        set maintainers ""
+    }
+    if {[info exists portinfo(variants)]} {
+        set variants $portinfo(variants)
+    } else {
+        set variants ""
+    }
+    if {[info exists portinfo(depends_build)]} {
+        set depends_build $portinfo(depends_build)
+    } else {
+        set depends_build ""
+    }
+    if {[info exists portinfo(depends_lib)]} {
+        set depends_lib $portinfo(depends_lib)
+    } else {
+        set depends_lib ""
+    }
+    if {[info exists portinfo(depends_run)]} {
+        set depends_run $portinfo(depends_run)
+    } else {
+        set depends_run ""
+    }
+    if {[info exists portinfo(platforms)]} {
+        set platforms $portinfo(platforms)
+    } else {
+        set platforms ""
+    }
+
+    puts $sqlfile_fd "INSERT INTO portfiles VALUES ('$portname', '$portdir', '$portversion', '$description');"
+
+    set primary 1
+    foreach category $categories {
+        set category [sql_escape $category]
+        puts $sqlfile_fd "INSERT INTO categories VALUES ('$portname', '$category', $primary);"
+        incr primary
+    }
+    
+    set primary 1
+    foreach maintainer $maintainers {
+        set maintainer [sql_escape $maintainer]
+        puts $sqlfile_fd "INSERT INTO maintainers VALUES ('$portname', '$maintainer', $primary);"
+        incr primary
+    }
+
+    foreach build_dep $depends_build {
+        set build_dep [sql_escape $build_dep]
+        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$build_dep');"
+    }
+
+    foreach lib $depends_lib {
+        set lib [sql_escape $lib]
+        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$lib');"
+    }
+
+    foreach run_dep $depends_run {
+        set run_dep [sql_escape $run_dep]
+        puts $sqlfile_fd "INSERT INTO dependencies VALUES ('$portname', '$run_dep');"
+    }
+
+    foreach variant $variants {
+        set variant [sql_escape $variant]
+        puts $sqlfile_fd "INSERT INTO variants VALUES ('$portname', '$variant');"
+    }
+
+    foreach platform $platforms {
+        set platform [sql_escape $platform]
+        puts $sqlfile_fd "INSERT INTO platforms VALUES ('$portname', '$platform');"
+    }
+
+}
+
+
+# Pipe the contents of the generated sql file to the database command,
+# reading from the file descriptor for the raw sql file to assure completeness.
+if {[catch {seek $sqlfile_fd 0 start} errstr]} {
+    ui_error "${::errorCode}: $errstr"
+    cleanup sqlfile lockfile
+    terminate 1
+}
+if {[catch {exec -- $dbcmd --host=$dbhost --user=$dbuser --password=$dbpasswd --database=$dbname <@ $sqlfile_fd} errstr]} {
+    ui_error "${::errorCode}: $errstr"
+    cleanup sqlfile lockfile
+    terminate 1
+}
+
+
+# And we're done regen'ing the MacPorts dabase! Cleanup and exit successfully.
+cleanup sqlfile lockfile
+terminate 0

Copied: trunk/base/portmgr/jobs/PortIndexRegen.sh (from rev 30436, trunk/base/portmgr/PortIndexRegen.sh)
===================================================================
--- trunk/base/portmgr/jobs/PortIndexRegen.sh	                        (rev 0)
+++ trunk/base/portmgr/jobs/PortIndexRegen.sh	2007-10-28 05:58:31 UTC (rev 30447)
@@ -0,0 +1,135 @@
+#!/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=macports-dev at lists.macosforge.org,dluke at geeklair.net
+
+# Other settings (probably don't need to be changed).
+SVN_CONFIG_DIR=${ROOT}/svnconfig
+REPO_BASE=http://svn.macports.org/repository/macports
+RELEASE_URL_FILE="config/RELEASE_URL"
+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
+# 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 fuction 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?"
+    exit 1
+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
+
+# Extract the release URL from HEAD
+read RELEASE_URL < ${ROOT}/${TMPDIR}/${RELEASE_URL_FILE}
+[ -n ${RELEASE_URL} ] || { echo "no RELEASE_URL specified in svn HEAD." >> $FAILURE_LOG; bail ; }
+
+# Checkout/update the release base
+if [ -d ${SRCTREE}/base ]; then
+    $SVN switch ${RELEASE_URL} ${SRCTREE}/base > $FAILURE_LOG 2>&1 \
+	|| { echo "Updating base from ${RELEASE_URL} failed." >> $FAILURE_LOG; bail ; }
+else
+    $SVN checkout ${RELEASE_URL} ${SRCTREE}/base > $FAILURE_LOG 2>&1 \
+	|| { echo "Checking out base from ${RELEASE_URL} failed." >> $FAILURE_LOG ; bail ; }
+fi
+echo `date -u +%s` > ${ROOT}/BASE-TIMESTAMP
+
+# (re)configure.
+cd ${SRCTREE}/base/ && \
+    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 ${SRCTREE}/base/ && make clean > $FAILURE_LOG 2>&1 ; } \
+    || { echo "make clean failed." >> $FAILURE_LOG ; bail ; }
+
+# (re)build
+{ cd ${SRCTREE}/base/ && make > $FAILURE_LOG 2>&1 ; } \
+    || { echo "make failed." >> $FAILURE_LOG ; bail ; }
+
+# (re)install
+{ cd ${SRCTREE}/base/ && 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 > $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

Copied: trunk/base/portmgr/jobs/mprsyncup (from rev 30436, trunk/base/portmgr/mprsyncup)
===================================================================
--- trunk/base/portmgr/jobs/mprsyncup	                        (rev 0)
+++ trunk/base/portmgr/jobs/mprsyncup	2007-10-28 05:58:31 UTC (rev 30447)
@@ -0,0 +1,105 @@
+#!/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
+# tree from trunk (ToT), and then export and sync all of them to the
+# ${RSYNCROOT} location, wherefrom the rsync modules are fed to the `sync'
+# and `selfupdate' routines in port(1). Read the base/portmgr/rsync.repos
+# file for more information on both the necessary rsync modules and filesystem
+# level paths, which this script bootstraps.
+#
+# Whatever server uses this script to mirror the MacPorts rsync repositories
+# should simply adapt the ${RSYNCROOT} path variable as necessary (keeping it
+# in sync with the equally named variable in base/portmgr/rsync.repos) and
+# install it on cron/launchd with a suitable periodicity, previously discussed
+# with the portmgr@ team (macports-mgr at lists.macosforge.org). Repositories
+# themselves are detailed & served by base/portmgr/rsync.repos, as stated above
+# (that is, no manual intervention what-so-ever is needed, other than installing
+# this script and adding the repositories detailed in base/portmgr/rsync.repos
+# to a local rsyncd.conf file).
+#
+# Lastly, it is required of every 3rd party mirrors to keep track of this script
+# and the base/portmgr/rsync.repos file and always maintain local copies in as
+# close sync as possible. 
+#
+#
+# Created by fkr at opendarwin.org, jberry at macports.org and yeled at macports.org,
+# Updated by jmpp at macports.org
+# $Id$
+####
+
+set -e
+
+# Commands we need:
+SVN="/opt/local/bin/svn -q --non-interactive"
+RSYNC="/usr/bin/rsync -q"
+
+# Paths we'll work on:
+SVNROOT=/var/tmp/macports
+TBASE=${SVNROOT}/trunk/base
+RBASE=${SVNROOT}/release/base
+PORTS=${SVNROOT}/release/ports
+RSYNCROOT=/Volumes/data/rsync/macports
+
+# Sources information:
+SVNURL=http://svn.macports.org/repository/macports
+RELEASE_URL_FILE=config/RELEASE_URL
+
+
+# Update/checkout trunk's base, export and rsync it to the rsync repos location (${RSYNCROOT}):
+if [ -d ${TBASE}/.svn ]; then
+    ${SVN} update ${TBASE}
+else
+    ${SVN} checkout ${SVNURL}/trunk/base ${TBASE}
+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
+
+
+# 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
+    echo "no RELEASE_URL specified in svn trunk, baling out"
+    exit 1
+fi
+if [ -d ${RBASE}/.svn ]; then
+    ${SVN} switch ${RELEASE_URL} ${RBASE}
+else
+    ${SVN} checkout ${RELEASE_URL} ${RBASE}
+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
+
+
+# Update/checkout the ports tree, export it and rsync it to ${RSYNCROOT}/release/ports:
+if [ -d ${PORTS}/.svn ]; then
+  ${SVN} update ${PORTS}  
+else
+    ${SVN} checkout ${SVNURL}/trunk/dports ${PORTS}
+fi
+${SVN} export ${PORTS} ${PORTS}-export
+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
+
+
+# Compatibility checks:
+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
+fi

Added: trunk/base/portmgr/jobs/org.macports.GuideRegen.plist
===================================================================


Property changes on: trunk/base/portmgr/jobs/org.macports.GuideRegen.plist
___________________________________________________________________
Name: svn:eol-stype
   + native

Copied: trunk/base/portmgr/jobs/org.macports.PortIndex2MySQL.plist (from rev 30436, trunk/base/portmgr/org.macports.PortIndex2MySQL.plist)
===================================================================
--- trunk/base/portmgr/jobs/org.macports.PortIndex2MySQL.plist	                        (rev 0)
+++ trunk/base/portmgr/jobs/org.macports.PortIndex2MySQL.plist	2007-10-28 05:58:31 UTC (rev 30447)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>Debug</key>
+	<false/>
+	<key>Label</key>
+	<string>org.macports.PortIndex2MySQL</string>
+	<key>OnDemand</key>
+	<true/>
+	<key>ProgramArguments</key>
+	<array>
+		<string>/opt/local/share/macports/resources/portmgr/PortIndex2MySQL</string>
+	</array>
+	<key>RunAtLoad</key>
+	<false/>
+	<key>StartCalendarInterval</key>
+	<dict>
+		<key>Hour</key>
+		<integer>4</integer>
+		<key>Minute</key>
+		<integer>15</integer>
+	</dict>
+	<key>StartInterval</key>
+	<integer>43200</integer>
+        <key>UserName</key>
+        <string>juan</string>
+</dict>
+</plist>

Added: trunk/base/portmgr/jobs/org.macports.PortIndexRegen.plist
===================================================================


Property changes on: trunk/base/portmgr/jobs/org.macports.PortIndexRegen.plist
___________________________________________________________________
Name: svn:eol-stype
   + native

Added: trunk/base/portmgr/jobs/org.macports.mprsyncup.plist
===================================================================


Property changes on: trunk/base/portmgr/jobs/org.macports.mprsyncup.plist
___________________________________________________________________
Name: svn:eol-stype
   + native

Deleted: trunk/base/portmgr/mprsyncup
===================================================================
--- trunk/base/portmgr/mprsyncup	2007-10-28 05:43:42 UTC (rev 30446)
+++ trunk/base/portmgr/mprsyncup	2007-10-28 05:58:31 UTC (rev 30447)
@@ -1,105 +0,0 @@
-#!/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
-# tree from trunk (ToT), and then export and sync all of them to the
-# ${RSYNCROOT} location, wherefrom the rsync modules are fed to the `sync'
-# and `selfupdate' routines in port(1). Read the base/portmgr/rsync.repos
-# file for more information on both the necessary rsync modules and filesystem
-# level paths, which this script bootstraps.
-#
-# Whatever server uses this script to mirror the MacPorts rsync repositories
-# should simply adapt the ${RSYNCROOT} path variable as necessary (keeping it
-# in sync with the equally named variable in base/portmgr/rsync.repos) and
-# install it on cron/launchd with a suitable periodicity, previously discussed
-# with the portmgr@ team (macports-mgr at lists.macosforge.org). Repositories
-# themselves are detailed & served by base/portmgr/rsync.repos, as stated above
-# (that is, no manual intervention what-so-ever is needed, other than installing
-# this script and adding the repositories detailed in base/portmgr/rsync.repos
-# to a local rsyncd.conf file).
-#
-# Lastly, it is required of every 3rd party mirrors to keep track of this script
-# and the base/portmgr/rsync.repos file and always maintain local copies in as
-# close sync as possible. 
-#
-#
-# Created by fkr at opendarwin.org, jberry at macports.org and yeled at macports.org,
-# Updated by jmpp at macports.org
-# $Id$
-####
-
-set -e
-
-# Commands we need:
-SVN="/opt/local/bin/svn -q --non-interactive"
-RSYNC="/usr/bin/rsync -q"
-
-# Paths we'll work on:
-SVNROOT=/var/tmp/macports
-TBASE=${SVNROOT}/trunk/base
-RBASE=${SVNROOT}/release/base
-PORTS=${SVNROOT}/release/ports
-RSYNCROOT=/Volumes/data/rsync/macports
-
-# Sources information:
-SVNURL=http://svn.macports.org/repository/macports
-RELEASE_URL_FILE=config/RELEASE_URL
-
-
-# Update/checkout trunk's base, export and rsync it to the rsync repos location (${RSYNCROOT}):
-if [ -d ${TBASE}/.svn ]; then
-    ${SVN} update ${TBASE}
-else
-    ${SVN} checkout ${SVNURL}/trunk/base ${TBASE}
-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
-
-
-# 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
-    echo "no RELEASE_URL specified in svn trunk, baling out"
-    exit 1
-fi
-if [ -d ${RBASE}/.svn ]; then
-    ${SVN} switch ${RELEASE_URL} ${RBASE}
-else
-    ${SVN} checkout ${RELEASE_URL} ${RBASE}
-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
-
-
-# Update/checkout the ports tree, export it and rsync it to ${RSYNCROOT}/release/ports:
-if [ -d ${PORTS}/.svn ]; then
-  ${SVN} update ${PORTS}  
-else
-    ${SVN} checkout ${SVNURL}/trunk/dports ${PORTS}
-fi
-${SVN} export ${PORTS} ${PORTS}-export
-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
-
-
-# Compatibility checks:
-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
-fi

Deleted: trunk/base/portmgr/org.macports.PortIndex2MySQL.plist
===================================================================
--- trunk/base/portmgr/org.macports.PortIndex2MySQL.plist	2007-10-28 05:43:42 UTC (rev 30446)
+++ trunk/base/portmgr/org.macports.PortIndex2MySQL.plist	2007-10-28 05:58:31 UTC (rev 30447)
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>Debug</key>
-	<false/>
-	<key>Label</key>
-	<string>org.macports.PortIndex2MySQL</string>
-	<key>OnDemand</key>
-	<true/>
-	<key>ProgramArguments</key>
-	<array>
-		<string>/opt/local/share/macports/resources/portmgr/PortIndex2MySQL</string>
-	</array>
-	<key>RunAtLoad</key>
-	<false/>
-	<key>StartCalendarInterval</key>
-	<dict>
-		<key>Hour</key>
-		<integer>4</integer>
-		<key>Minute</key>
-		<integer>15</integer>
-	</dict>
-	<key>StartInterval</key>
-	<integer>43200</integer>
-        <key>UserName</key>
-        <string>juan</string>
-</dict>
-</plist>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071027/80f59a36/attachment-0001.html


More information about the macports-changes mailing list