[51708] users/febeling/mpab
febeling at macports.org
febeling at macports.org
Mon Jun 1 00:57:29 PDT 2009
Revision: 51708
http://trac.macports.org/changeset/51708
Author: febeling at macports.org
Date: 2009-06-01 00:57:29 -0700 (Mon, 01 Jun 2009)
Log Message:
-----------
buildports: fix uninstall ports operation, and small fixes.
Modified Paths:
--------------
users/febeling/mpab/ChangeLog
users/febeling/mpab/chroot-scripts/buildports
users/febeling/mpab/mpab-functions
Modified: users/febeling/mpab/ChangeLog
===================================================================
--- users/febeling/mpab/ChangeLog 2009-06-01 07:53:59 UTC (rev 51707)
+++ users/febeling/mpab/ChangeLog 2009-06-01 07:57:29 UTC (rev 51708)
@@ -1,3 +1,13 @@
+2009-06-01 Florian Ebeling <febeling at macports.org>
+
+ * mpab-functions (uninstallPorts): operate on `port list active'
+ instead of `port installed'
+
+ * mpab-functions: factor out function `chroot_exec'
+
+ * mpab-functions: add /Developer/Applications/Xcode.app to
+ pathsToCopy list
+
2009-04-13 Florian Ebeling <febeling at macports.org>
* chroot-scripts/buildports (uninstallPorts): Fix: use -x on
Modified: users/febeling/mpab/chroot-scripts/buildports
===================================================================
--- users/febeling/mpab/chroot-scripts/buildports 2009-06-01 07:53:59 UTC (rev 51707)
+++ users/febeling/mpab/chroot-scripts/buildports 2009-06-01 07:57:29 UTC (rev 51708)
@@ -32,7 +32,7 @@
function uninstallPorts()
{
- installedPorts=`/opt/local/bin/port installed | /usr/bin/tail +2 | /usr/bin/awk '{print $1}'`
+ installedPorts=`/opt/local/bin/port list active | /usr/bin/awk '{print $1}'`
for uninstallPort in $installedPorts; do
portOutput=`/opt/local/bin/port -xdvf deactivate $uninstallPort 2>&1`
if [[ $? != 0 ]]; then
@@ -107,7 +107,7 @@
fi
done
if [[ -z $skipPort ]]; then
- /opt/local/bin/port -dvxo install $portName > ${PORTRESULTSDIR}/${portName}.log 2>&1
+ /opt/local/bin/port -dvx install $portName > ${PORTRESULTSDIR}/${portName}.log 2>&1
if [[ $? == 0 ]]; then
/bin/mv ${PORTRESULTSDIR}/${portName}.log ${PORTRESULTSDIR}/success
echo "success"
Modified: users/febeling/mpab/mpab-functions
===================================================================
--- users/febeling/mpab/mpab-functions 2009-06-01 07:53:59 UTC (rev 51707)
+++ users/febeling/mpab/mpab-functions 2009-06-01 07:57:29 UTC (rev 51708)
@@ -116,7 +116,7 @@
pathsToCreate="private/etc private/var/folders private/var/log private/var/spool private/var/run private/var/tmp private/var/db/dyld private/tmp"
# Paths to copy to the chroot
- pathsToCopy="private/etc/bashrc private/etc/group private/etc/hosts private/etc/pam.d private/etc/passwd private/etc/profile private/etc/shells private/var/root bin sbin etc tmp var usr/bin usr/include usr/lib usr/libexec usr/sbin usr/share usr/X11 usr/X11R6 Developer/Headers Developer/Library Developer/Makefiles Developer/Platforms Developer/Private Developer/SDKs Developer/Tools Developer/usr System/Library/CoreServices System/Library/Filesystems System/Library/Frameworks System/Library/Java System/Library/Perl System/Library/PrivateFrameworks System/Library/Tcl"
+ pathsToCopy="private/etc/bashrc private/etc/group private/etc/hosts private/etc/pam.d private/etc/passwd private/etc/profile private/etc/shells private/var/root bin sbin etc tmp var usr/bin usr/include usr/lib usr/libexec usr/sbin usr/share usr/X11 usr/X11R6 Developer/Headers Developer/Library Developer/Makefiles Developer/Platforms Developer/Private Developer/SDKs Developer/Tools Developer/usr System/Library/CoreServices System/Library/Filesystems System/Library/Frameworks System/Library/Java System/Library/Perl System/Library/PrivateFrameworks System/Library/Tcl Developer/Applications/Xcode.app"
# Size of the disk images (hdiutil nomenclature)
imageSize="32g"
@@ -151,6 +151,7 @@
done
for copypath in ${pathsToCopy}; do
+ echo "Copying ${copypath}..." ###
pax -r -w -pe $copypath ${chrootPath}
done
cd - > /dev/null
@@ -226,12 +227,9 @@
fi
if [[ ! -f ${chrootPath}/opt/local/bin/port ]]; then
- cp -p ${baseDir}/chroot-scripts/installmacports ${chrootPath}/var/tmp/
- # Set DYLD_NO_FIX_PREBINDING as otherwise, on 10.5, dyld will spew
- # errors to syslog/console log like:
- # com.apple.launchd[1] (com.apple.dyld): Throttling respawn: Will start in 10 seconds
- env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/var/root DYLD_NO_FIX_PREBINDING=1 /usr/sbin/chroot ${chrootPath} /bin/sh /var/tmp/installmacports
- rm ${chrootPath}/var/tmp/installmacports ###
+
+ chroot_exec installmacports
+
sed 's/portarchivemode.*no/portarchivemode yes/' ${chrootPath}/opt/local/etc/macports/macports.conf > ${chrootPath}/opt/local/etc/macports/macports.conf.new
mv ${chrootPath}/opt/local/etc/macports/macports.conf.new ${chrootPath}/opt/local/etc/macports/macports.conf
fi
@@ -252,13 +250,9 @@
echo "Building ports"
- cp -p ${baseDir}/chroot-scripts/buildports ${chrootPath}/var/tmp/
cp -p ${baseDir}/chroot-scripts/genportlist.tcl ${chrootPath}/var/tmp/
- # Set DYLD_NO_FIX_PREBINDING as otherwise, on 10.5, dyld will spew
- # errors to syslog/console log like:
- # com.apple.launchd[1] (com.apple.dyld): Throttling respawn: Will start in 10 seconds
- env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/var/root DYLD_NO_FIX_PREBINDING=1 /usr/sbin/chroot ${chrootPath} /bin/sh /var/tmp/buildports
+ chroot_exec buildports
return 0
}
@@ -272,10 +266,7 @@
cp -p ${baseDir}/chroot-scripts/chrootshell ${chrootPath}/var/tmp/
- # Set DYLD_NO_FIX_PREBINDING as otherwise, on 10.5, dyld will spew
- # errors to syslog/console log like:
- # com.apple.launchd[1] (com.apple.dyld): Throttling respawn: Will start in 10 seconds
- env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/var/root DYLD_NO_FIX_PREBINDING=1 /usr/sbin/chroot ${chrootPath} /bin/sh /var/tmp/chrootshell
+ chroot_exec chrootshell
echo "Chroot shell exited"
@@ -374,6 +365,21 @@
return 0
}
+
+#------------------------------------------------------------------------
+# Execute a script inside the chroot environment. Includes copying it
+# into a temp file and removing it afterwards
+# $1 - script to execute
+function chroot_exec () {
+ cp -p ${baseDir}/chroot-scripts/$1 ${chrootPath}/var/tmp
+ # Set DYLD_NO_FIX_PREBINDING as otherwise, on 10.5, dyld will spew
+ # errors to syslog/console log like:
+ # com.apple.launchd[1] (com.apple.dyld): Throttling respawn: Will start in 10 seconds
+ env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/var/root DYLD_NO_FIX_PREBINDING=1 /usr/sbin/chroot ${chrootPath} /bin/sh /var/tmp/$1
+ rm ${chrootPath}/var/tmp/$1
+}
+
+
# Local Variables:
# mode: shell-script
# indent-tabs-mode: nil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090601/c70f4125/attachment-0001.html>
More information about the macports-changes
mailing list