[23347] branches/release_1_4/base/portmgr/IndexRegen.sh
source_changes at macosforge.org
source_changes at macosforge.org
Thu Mar 29 10:29:50 PDT 2007
Revision: 23347
http://trac.macosforge.org/projects/macports/changeset/23347
Author: jmpp at macports.org
Date: 2007-03-29 10:29:50 -0700 (Thu, 29 Mar 2007)
Log Message:
-----------
Bootstrapping svn credentials into $SVN_CONFIG_DIR seems like a non-trivial process, so lets not attempt it.
Bail out if there's no dports tree and/or base sources prior to running the script, so that the user bootstraps
the entire thing manually (informing him/her what to do). Also some small comment and 'echo' updates.
Modified Paths:
--------------
branches/release_1_4/base/portmgr/IndexRegen.sh
Modified: branches/release_1_4/base/portmgr/IndexRegen.sh
===================================================================
--- branches/release_1_4/base/portmgr/IndexRegen.sh 2007-03-29 13:50:42 UTC (rev 23346)
+++ branches/release_1_4/base/portmgr/IndexRegen.sh 2007-03-29 17:29:50 UTC (rev 23347)
@@ -11,7 +11,7 @@
# Configuration
LOCKFILE=/tmp/.mp_svn_index_regen.lock
-# ROOT directory, where everything is.
+# ROOT directory, where everything is. This needs to exist!
ROOT=/Users/dluke/Projects/mp_svn_index_regen
# MP user.
MP_USER=dluke
@@ -24,11 +24,11 @@
SVN_DPORTS_URL=http://svn.macports.org/repository/macports/trunk/dports
SVN_BASE_URL=http://svn.macports.org/repository/macports/branches/release_1_4/base
SVN_CONFIG_DIR=${ROOT}/svnconfig
-# Where to checkout the source code. This gets created.
+# Where to checkout the source code. This needs to exist!
SRCTREE=${ROOT}/source
-# Where DP will install its world. This gets created.
+# Where MP will install its world. This gets created.
PREFIX=${ROOT}/opt/local
-# Where DP installs darwinports1.0. This gets created.
+# Where MP installs darwinports1.0. This gets created.
TCLPKG=${PREFIX}/lib/tcl
# Path.
PATH=${PREFIX}/bin:/bin:/usr/bin:/opt/local/bin
@@ -60,28 +60,24 @@
exit 1
fi
-# Checkout both the ports tree and base sources if required, update otherwise.
-mkdir -p ${SRCTREE}
-if [ ! -d ${SRCTREE}/dports ]; then
- cd ${SRCTREE} && \
- svn -q --non-interactive --config-dir $SVN_CONFIG_DIR co $SVN_DPORTS_URL dports > $FAILURE_LOG 2>&1 \
- || { echo "Checking out the ports tree from $SVN_DPORTS_URL failed" >> $FAILURE_LOG ; bail ; }
+# Update both the ports tree and base sources, bail out if they don't exist beforehand.
+if [ ! -d ${SRCTREE}/dports/.svn ]; then
+ echo "No dports tree found at ${SRCTREE}. This needs to exist (with proper svn \
+ credentials at ${SVN_CONFIG_DIR}) prior to runnig this script." > $FAILURE_LOG; bail
else
cd ${SRCTREE}/dports && \
svn -q --non-interactive --config-dir $SVN_CONFIG_DIR update > $FAILURE_LOG 2>&1 \
- || { echo "Updating the ports tree from $SVN_DPORTS_URL failed" >> $FAILURE_LOG ; bail ; }
+ || { echo "Updating the ports tree from $SVN_DPORTS_URL failed." >> $FAILURE_LOG ; bail ; }
fi
-if [ ! -d ${SRCTREE}/base ]; then
- cd ${SRCTREE} && \
- svn -q --non-interactive --config-dir $SVN_CONFIG_DIR co $SVN_BASE_URL base > $FAILURE_LOG 2>&1 \
- || { echo "Checking out the base sources from $SVN_BASE_URL failed" >> $FAILURE_LOG ; bail ; }
+if [ ! -d ${SRCTREE}/base/.svn ]; then
+ echo "No base sources found at ${SRCTREE}. This needs to exist (with proper svn \
+ credentials at ${SVN_CONFIG_DIR}) prior to running this script." > $FAILURE_LOG; bail
else
cd ${SRCTREE}/base && \
svn -q --non-interactive --config-dir $SVN_CONFIG_DIR update > $FAILURE_LOG 2>&1 \
- || { echo "Updating the base sources from $SVN_BASE_URL failed" >> $FAILURE_LOG ; bail ; }
+ || { echo "Updating the base sources from $SVN_BASE_URL failed." >> $FAILURE_LOG ; bail ; }
fi
-
# (re)configure.
cd ${SRCTREE}/base/ && \
mkdir -p ${TCLPKG} && \
@@ -90,24 +86,24 @@
--with-tclpackage=${TCLPKG} \
--with-install-user=${MP_USER} \
--with-install-group=${MP_GROUP} > $FAILURE_LOG 2>&1 \
- || { echo "./configure failed" >> $FAILURE_LOG ; bail ; }
+ || { 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 ; }
+ || { echo "make clean failed." >> $FAILURE_LOG ; bail ; }
# (re)build
{ cd ${SRCTREE}/base/ && make > $FAILURE_LOG 2>&1 ; } \
- || { echo "make failed" >> $FAILURE_LOG ; bail ; }
+ || { echo "make failed." >> $FAILURE_LOG ; bail ; }
# (re)install
{ cd ${SRCTREE}/base/ && make install > $FAILURE_LOG 2>&1 ; } \
- || { echo "make install failed" >> $FAILURE_LOG ; bail ; }
+ || { 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 ; }
+ || { 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
@@ -116,7 +112,7 @@
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 ; }
+ || { echo "SVN commit failed." >> $FAILURE_LOG ; bail ; }
# At this point the index was committed successfuly, so we cleanup before we exit.
cleanup
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070329/6830340e/attachment.html
More information about the macports-changes
mailing list