[25914] branches/dp2mp-move/base

source_changes at macosforge.org source_changes at macosforge.org
Tue Jun 5 09:41:14 PDT 2007


Revision: 25914
          http://trac.macosforge.org/projects/macports/changeset/25914
Author:   jmpp at macports.org
Date:     2007-06-05 09:41:13 -0700 (Tue, 05 Jun 2007)

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

 * Update the rsync.repos file to better explain what's needed at the rsync server level with respect to necessary repos and filesystem level paths;
 * Update the mprsyncup.new script to not only be a bit more self-explanatory, but also to be self contained (that is, to bootstrap the rsync repos
and paths as necessary, without human intervention --including the DarwinPorts namespace compatibility links--)
 * Include the base level dir in the RELEASE_URL file, so that it works with the new mprsyncup.new script;
 * Update the IndexRegen.sh script to work with the new RELEASE_URL file.

All of this work needs to be pushed to the rsync server in coordination with this branch being merged to trunk, which is something I'll arrange with
MacOSForge admin personnel.

Modified Paths:
--------------
    branches/dp2mp-move/base/config/RELEASE_URL
    branches/dp2mp-move/base/portmgr/IndexRegen.sh
    branches/dp2mp-move/base/portmgr/mprsyncup.new
    branches/dp2mp-move/base/portmgr/rsync.repos

Modified: branches/dp2mp-move/base/config/RELEASE_URL
===================================================================
--- branches/dp2mp-move/base/config/RELEASE_URL	2007-06-05 15:38:39 UTC (rev 25913)
+++ branches/dp2mp-move/base/config/RELEASE_URL	2007-06-05 16:41:13 UTC (rev 25914)
@@ -1 +1 @@
-http://svn.macports.org/repository/macports/tags/release_1_4_42/
+http://svn.macports.org/repository/macports/tags/release_1_4_42/base

Modified: branches/dp2mp-move/base/portmgr/IndexRegen.sh
===================================================================
--- branches/dp2mp-move/base/portmgr/IndexRegen.sh	2007-06-05 15:38:39 UTC (rev 25913)
+++ branches/dp2mp-move/base/portmgr/IndexRegen.sh	2007-06-05 16:41:13 UTC (rev 25914)
@@ -69,6 +69,7 @@
     $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
@@ -79,7 +80,6 @@
     $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}/DPORTS-TIMESTAMP
 
 # Extract the release URL from HEAD
 read RELEASE_URL < ${ROOT}/${TMPDIR}/${RELEASE_URL_FILE}
@@ -87,11 +87,11 @@
 
 # Checkout/update the release base
 if [ -d ${SRCTREE}/base ]; then
-    $SVN switch ${RELEASE_URL}/base ${SRCTREE}/base > $FAILURE_LOG 2>&1 \
-	|| { echo "Updating base from ${RELEASE_URL}/base failed." >> $FAILURE_LOG; bail ; }
+    $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/base ${SRCTREE}/base > $FAILURE_LOG 2>&1 \
-	|| { echo "Checking out base from ${RELEASE_URL}/base failed." >> $FAILURE_LOG ; bail ; }
+    $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
 
@@ -132,4 +132,4 @@
     || { echo "SVN commit failed." >> $FAILURE_LOG ; bail ; }
 
 # At this point the index was committed successfuly, so we cleanup before we exit.
-cleanup
+cleanup && exit 0

Modified: branches/dp2mp-move/base/portmgr/mprsyncup.new
===================================================================
--- branches/dp2mp-move/base/portmgr/mprsyncup.new	2007-06-05 15:38:39 UTC (rev 25913)
+++ branches/dp2mp-move/base/portmgr/mprsyncup.new	2007-06-05 16:41:13 UTC (rev 25914)
@@ -3,58 +3,88 @@
 
 ####
 # 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 them to the ${REPOROOT} location, wherefrom the rsync modules are fed.
-# Read the base/portmgr/rsync.repos file for more information on both the rsync modules and necessary filesystem level paths layouts.
+# and a ports tree from trunk (ToT), and then export and sync all of them to the ${REPOROOT} 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.
+#
 # Created by fkr at opendarwin.org, jberry at macports.org and yeled at macports.org,
-# updated by jmpp 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"
 
-SVN="/opt/local/bin/svn -q --non-interactive"
-MPROOT=/usr/local/src/macosforge/macports
-REPOROOT=/usr/local/repos/macports
+# Paths we'll work on:
+SVNROOT=/tmp/macports
+TBASE=${SVNROOT}/trunk/base
+RBASE=${SVNROOT}/release/base
+PORTS=${SVNROOT}/release/ports
+RSYNCROOT=/usr/local/repos/macports
+
+# Sources information:
 SVNURL=http://svn.macports.org/repository/macports
 RELEASE_URL_FILE=config/RELEASE_URL
-RSYNC="/usr/bin/rsync -q"
 
 
-# Checkout trunk/base:
-BASE=${MPROOT}/trunk/base
-if [ -d ${BASE} ]; then
-    ${SVN} update ${BASE}
+# Update/checkout trunk's base, export and rsync it to the rsync repos location (${REPOROOT}):
+if [ -d ${TBASE}/.svn ]; then
+    ${SVN} update ${TBASE}
 else
-    ${SVN} checkout ${BASE}
+    ${SVN} checkout ${SVNURL}/trunk/base ${TBASE}
 fi
-${SVN} export ${BASE} ${BASE}-export
-${RSYNC} -a -I --delete ${BASE}-export/ ${REPOROOT}/trunk/base && rm -rf ${BASE}-export
+${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 releasign from, (check|update) it and export it:
-read RELEASE_URL < ${BASE}/${RELEASE_URL_FILE}
+# Read what tag we're releasign from, switch to/checkout a copy, export and rsync it to ${REPOROOT}/release/base:
+read RELEASE_URL < ${TBASE}/${RELEASE_URL_FILE}
 if [ ! -n ${RELEASE_URL} ]; then
-    echo "no RELEASE_URL specified in svn trunk"
+    echo "no RELEASE_URL specified in svn trunk, baling out"
     exit 1
 fi
-BASE=${MPROOT}/release
-if [ -d ${BASE} ]; then
-    ${SVN} switch ${RELEASE_URL} ${BASE}
+if [ -d ${RBASE}/.svn ]; then
+    ${SVN} switch ${RELEASE_URL} ${RBASE}
 else
-    ${SVN} checkout ${RELEASE_URL} ${BASE}
+    ${SVN} checkout ${RELEASE_URL} ${RBASE}
 fi
-${SVN} export ${BASE} ${BASE}-export
-${RSYNC} -a -I --delete ${BASE}-export/ ${REPOROOT}/release && rm -rf ${BASE}-export
+${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
 
 
-# Checkout the ports tree and export it to the release rsync repo:
-PORTS=${MPROOT}/trunk/dports
-if [ -d ${PORTS} ]; then
+# Update/checkout the ports tree, export it and rsync it to ${REPOROOT}/release/ports:
+if [ -d ${PORTS}/.svn ]; then
   ${SVN} update ${PORTS}  
 else
-    ${SVN} checkout ${PORTS}
+    ${SVN} checkout ${SVNURL}/trunk/dports ${PORTS}
 fi
 ${SVN} export ${PORTS} ${PORTS}-export
-${RSYNC} -a -I --delete ${PORTS}-export/ ${REPOROOT}/release/ports && rm -rf ${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

Modified: branches/dp2mp-move/base/portmgr/rsync.repos
===================================================================
--- branches/dp2mp-move/base/portmgr/rsync.repos	2007-06-05 15:38:39 UTC (rev 25913)
+++ branches/dp2mp-move/base/portmgr/rsync.repos	2007-06-05 16:41:13 UTC (rev 25914)
@@ -1,23 +1,44 @@
-
 #######
-# MacPorts rsync repos, feeding the sync & selfupdate procedures.
-# Two main modules are supplied for current installations and two for backwards compatibility (legacy darwinports namespace).
-# Assuming a REPOROOT path of /usr/local/repos/macports, this file is organized in the following modules and filesystem level paths:
+# MacPorts rsync repos feeding the sync & selfupdate procedures, created and maintained by the base/portmgr/mprsyncup.new script.
+# 
+# Two main modules are supplied for current installations off the dp2mp-move branch (intended to become mainstream moving forwad)
+# and two for backwards compatibility (legacy DarwinPorts namespace). Assuming an example REPOROOT path of /usr/local/repos/macports,
+# this file is organized in the following four modules and filesystem level paths (server side):
 #
-# ${REPOROOT}/release: holding a ports tree, exported from a checkout of svn's trunk (ToT), and the current release base dir,
-#    as determined by the base/config/RELEASE_URL file that's read by the base/portmgr/mprsyncup script;
 #
-# ${REPOROOT}/trunk: holding an export of a checkout from svn's trunk base dir (ToT);
+# PATHS:
 #
-# ${REPOROOT}/dpupdate: backwards compatible module, a filesystem level (relative) symlink to the trunk module;
+# ${REPOROOT}/release: holding a ports tree, exported from a checkout of svn's trunk/dports dir (ToT), and the current release base dir,
+#    as determined by the base/config/RELEASE_URL file read by the base/portmgr/mprsyncup.new script;
 #
-# ${REPOROOT}/dpupdate1: backwards compatible module, a filesystem level (relative) symlink to the release module.
+# ${REPOROOT}/trunk: holding an export of a checkout from svn's trunk/base dir (ToT);
 #
-# Futhermore the ${REPOROOT}/trunk path should also hold a (relative) `dports' symlink to ../release/ports,
-# so that a sync operation against `dpupdate/ports' for the ports tree works on legacy MacPorts installations.
-# Whatever server pretends to use this file should simply add the modules listed here to an already tailored
-# rsyncd.conf file, as no other particular config flags are supplied.
+# ${REPOROOT}/dpupdate: backwards compatible path & module, a filesystem level (relative) symlink to the trunk path above
+#    (relative to ${REPOROOT}: dpupdate --> trunk);
 #
+# ${REPOROOT}/dpupdate1: backwards compatible path & module, a filesystem level (relative) symlink to the release path
+#    (relative to ${REPOROOT}: dpupdate1 --> release).
+#
+# 
+# Futhermore the ${REPOROOT}/trunk path must also hold a (relative) `dports' symlink to `../release/ports',
+# so that a sync operation against `dpupdate/ports' for the ports tree works on legacy MacPorts installations
+# (DarwinPorts namespace). Overall, the ${REPOROOT} skeleton should look like:
+#
+# release/
+# release/base/
+# release/ports/
+# trunk/
+# trunk/base/
+# trunk/dports --> ../release/ports
+# dpupdate --> trunk
+# dpupdate1 --> release
+#
+#
+# Whatever server uses this file should simply add the modules listed here to an already
+# tailored rsyncd.conf file, as no other particular config options are supplied.
+# Repositories themselves are created and maintained by the base/portmgr/mprsyncup.new script, as stated above
+# (that is, no manual intervention what-so-ever is needed, other than adding the repos to the local rsyncd.conf file).
+#
 # Created by Juan Manuel Palacios,
 # e-mail: jmpp at macports.org
 # $Id$
@@ -33,9 +54,9 @@
 	path = /usr/local/repos/macports/trunk
 
 [dpupdate]
-	comment = legacy MacPorts ToT rsync repo, ports tree and base component (solely for backwards compatibility purposes).
+	comment = Legacy MacPorts ToT rsync repo, ports tree and base component (solely for backwards compatibility purposes).
 	path = /usr/local/repos/macports/dpupdate
 
 [dpupdate1]
-	comment = legacy MacPorts rsync dpupdate1 repo, released base component (solely for backwards compatibility purposes).
+	comment = Legacy MacPorts rsync dpupdate1 repo, release base component (solely for backwards compatibility purposes).
 	path = /usr/local/repos/macports/dpupdate1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070605/686cbaf9/attachment.html


More information about the macports-changes mailing list