[darwinbuild-changes] [138] trunk/darwinbuild
source_changes at macosforge.org
source_changes at macosforge.org
Wed Oct 4 01:50:18 PDT 2006
Revision: 138
http://trac.macosforge.org/projects/darwinbuild/changeset/138
Author: ssen
Date: 2006-10-04 01:50:17 -0700 (Wed, 04 Oct 2006)
Log Message:
-----------
Allow -depsbuild to be multiply specified. Roots are searched
for in the order of builds given by -depsbuild arguments. As before,
the default is the current build.
This is useful if you are in the process of doing a new build and
want some of your new roots to be used but fall back to an older
build if necessary. This would currently only work if you have
a fully populated $DARWIN_BUILDROOT/Roots directory, and doesn't
work for "binary_sites"
Modified Paths:
--------------
trunk/darwinbuild/darwinbuild
trunk/darwinbuild/darwinbuild.common
Modified: trunk/darwinbuild/darwinbuild
===================================================================
--- trunk/darwinbuild/darwinbuild 2005-07-31 00:47:05 UTC (rev 137)
+++ trunk/darwinbuild/darwinbuild 2006-10-04 08:50:17 UTC (rev 138)
@@ -149,7 +149,7 @@
function PrintUsage() {
echo "usage: $(basename $0) [flags] <project> [<version>]" 1>&2
echo "usage: flags: [-headers] [-build=X] [-target=X]" 1>&2
- echo " [-logdeps] [-nochroot] [-noload] [-depsbuild=X]" 1>&2
+ echo " [-logdeps] [-nochroot] [-noload] [-depsbuild=X [-depsbuild=Y]]" 1>&2
echo " [-fetch] [-source]" 1>&2
exit 1
}
@@ -249,7 +249,7 @@
elif [ "${ARG/=*/}" == "-build" ]; then
build="${ARG/*=/}"
elif [ "${ARG/=*/}" == "-depsbuild" ]; then
- depsbuild="${ARG/*=/}"
+ depsbuild="${depsbuild} ${ARG/*=/}"
elif [ "$ARG" == "-nochroot" ]; then
export CHROOTED="NO"
elif [ "$ARG" == "-noload" ]; then
@@ -475,7 +475,7 @@
deps=$($PREFIX/bin/darwinxref dependencies -build "$projnam")
for X in files bash $bash_deps $deps ; do
- InstallRoot "$BuildRoot" "$X"
+ InstallRoot "$BuildRoot" "$X" "$depsbuild"
done
### so many things require ditto, we have hacked around it
@@ -486,7 +486,7 @@
echo "*** Installing Headers ..."
deps=$($PREFIX/bin/darwinxref dependencies -header "$projnam")
for X in $deps ; do
- InstallHeaders "$BuildRoot" "$X"
+ InstallHeaders "$BuildRoot" "$X" "$depsbuild"
done
### xcodebuild is a special case because it is not open source
Modified: trunk/darwinbuild/darwinbuild.common
===================================================================
--- trunk/darwinbuild/darwinbuild.common 2005-07-31 00:47:05 UTC (rev 137)
+++ trunk/darwinbuild/darwinbuild.common 2006-10-04 08:50:17 UTC (rev 138)
@@ -81,7 +81,6 @@
###
### Download the sources,
- ### and any applicable patches.
###
for master_site in $master_sites ;
do
@@ -113,6 +112,7 @@
function InstallRoot() {
local BuildRoot="$1"
local X="$2"
+ local depsbuilds="$3"
local receipts="$BuildRoot/usr/local/darwinbuild/receipts"
mkdir -p "$receipts"
@@ -141,20 +141,27 @@
ditto $SRCDIR $BuildRoot
touch "$receipts/$X"
elif [ ! -f "$receipts/$X" ]; then
- sites=$($PREFIX/bin/darwinxref $dbfile binary_sites | while read a; do echo "$a/$depsbuild"; done)
- Download "$CACHEDIR/Roots/$depsbuild" \
+ # install a pre-built root, using the depsbuilds array, in preference order
+ for dbuild in $depsbuilds; do
+ sites=$($PREFIX/bin/darwinxref $dbfile binary_sites | while read a; do echo "$a/$dbuild"; done)
+ Download "$CACHEDIR/Roots/$dbuild" \
"$X.root.tar.gz" \
"$sites"
- if [ -f $CACHEDIR/Roots/$depsbuild/$X.root.tar.gz ]; then
+ if [ -f $CACHEDIR/Roots/$dbuild/$X.root.tar.gz ]; then
cd "$BuildRoot"
- tar xzf $CACHEDIR/Roots/$depsbuild/$X.root.tar.gz
+ tar xzf $CACHEDIR/Roots/$dbuild/$X.root.tar.gz
if [ "$?" == "0" ]; then
touch "$receipts/$X"
+ break
fi
- else
+ fi
+
+ # if we didn't find the root for this build, keep looking in the next build
+ done
+ if [ ! -f "$receipts/$X" ]; then
echo "ERROR: could not find root: $X" 1>&2
- exit 1
- fi
+ exi
+ fi
fi
### Restore CF if necessary
@@ -172,6 +179,7 @@
function InstallHeaders() {
local BuildRoot="$1"
local X="$2"
+ local depsbuilds="$3"
local receipts="$BuildRoot/usr/local/darwinbuild/receipts"
if [ ! -f "$receipts/$X.hdrs" -a ! -f "$receipts/$X" ]; then
@@ -180,18 +188,28 @@
echo "Copying $X ..."
ditto $DARWIN_BUILDROOT/Headers/${X/-*}/$X.hdrs~$bv $BuildRoot
else
- sites=$($PREFIX/bin/darwinxref $dbfile binary_sites | while read a; do echo "$a/$depsbuild"; done)
- Download "$CACHEDIR/Headers/$depsbuild" "$X.hdrs.tar.gz" \
+
+ # install a pre-built root, using the depsbuilds array, in preference order
+ for dbuild in $depsbuilds; do
+ sites=$($PREFIX/bin/darwinxref $dbfile binary_sites | while read a; do echo "$a/$dbuild"; done)
+ Download "$CACHEDIR/Headers/$dbuild" \
+ "$X.hdrs.tar.gz" \
"$sites"
- if [ -f $CACHEDIR/Headers/$depsbuild/$X.hdrs.tar.gz ]; then
+ if [ -f $CACHEDIR/Headers/$dbuild/$X.hdrs.tar.gz ]; then
cd "$BuildRoot"
- tar xzf $CACHEDIR/Headers/$depsbuild/$X.hdrs.tar.gz
+ tar xzf $CACHEDIR/Headers/$dbuild/$X.hdrs.tar.gz
if [ "$?" == "0" ]; then
touch "$receipts/$X.hdrs"
+ break
fi
else
- InstallRoot "$BuildRoot" "$X"
+ InstallRoot "$BuildRoot" "$X" "$depsbuilds"
fi
+ # XXX some may think this is buggy. If you fail to find
+ # a header root for the first build, normal roots
+ # are searched for along the build chain. Secondary
+ # builds are never consulted for header roots
+ done
fi
fi
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20061004/d18f57ce/attachment.html
More information about the darwinbuild-changes
mailing list