Revision: 542 http://trac.macosforge.org/projects/darwinbuild/changeset/542 Author: wsiegrist@apple.com Date: 2009-08-09 12:58:14 -0700 (Sun, 09 Aug 2009) Log Message: ----------- Add support for subversion working copies as project sources Modified Paths: -------------- trunk/darwinbuild/darwinbuild.common trunk/darwinbuild/darwinbuild.in Added Paths: ----------- trunk/darwinxref/plugins/branch.tcl Modified: trunk/darwinbuild/darwinbuild.common =================================================================== --- trunk/darwinbuild/darwinbuild.common 2009-08-09 08:18:55 UTC (rev 541) +++ trunk/darwinbuild/darwinbuild.common 2009-08-09 19:58:14 UTC (rev 542) @@ -107,6 +107,27 @@ CURLARGS=${CURLARGS:-} ### +### Checkout or update a project from subversion repository +### +function CheckoutOrUpdate() { + local destination="$1" + local branch="$2" + local master_sites="$3" + + for master_site in $master_sites ; + do + if [ ! -d "$destination/.svn" ]; then + echo "Checking out working copy" + mkdir -p "$destination" + svn co "$master_site/$branch" "$destination" && break + else + echo "Updating working copy" + svn up "$destination" && break + fi + done +} + +### ### Download a .tar.gz file ### function Download() { Modified: trunk/darwinbuild/darwinbuild.in =================================================================== --- trunk/darwinbuild/darwinbuild.in 2009-08-09 08:18:55 UTC (rev 541) +++ trunk/darwinbuild/darwinbuild.in 2009-08-09 19:58:14 UTC (rev 542) @@ -445,6 +445,13 @@ exit 1 fi +# check for the project being subversion based +branch=$($DARWINXREF branch $projnam) +if [ "$branch" != "" ]; then + # using subversion implies nosource + nosource="YES" +fi + ### ### Download the sources, ### and any applicable patches. @@ -459,11 +466,11 @@ filename="$project.tar.gz" fi - Download "$SourceCache" "$filename" "$($DARWINXREF source_sites $projnam)" + Download "$SourceCache" "$filename" "$($DARWINXREF source_sites $projnam)" patchfilenames=$($DARWINXREF patchfiles $projnam) for p in $patchfilenames; do - Download "$SourceCache" "$p" "$($DARWINXREF source_sites $projnam)" + Download "$SourceCache" "$p" "$($DARWINXREF source_sites $projnam)" done ### If we are doing a -fetch, stop here. @@ -535,6 +542,11 @@ fi fi +if [ "$branch" != "" ]; then + mkdir -p "$REAL_SRCROOT" "$REAL_OBJROOT" "$REAL_SYMROOT" "$REAL_DSTROOT" + CheckoutOrUpdate "$REAL_SRCROOT" "$branch" "$($DARWINXREF source_sites $projnam)" +fi + # you can avoid registering patches in the DB by using "xnu-792--patches.tar.gz" if [ -r "$SourceCache/$project-patches.tar.gz" -a "$nosource" != "YES" ]; then tar xzf "$SourceCache/$project-patches.tar.gz" Added: trunk/darwinxref/plugins/branch.tcl =================================================================== --- trunk/darwinxref/plugins/branch.tcl (rev 0) +++ trunk/darwinxref/plugins/branch.tcl 2009-08-09 19:58:14 UTC (rev 542) @@ -0,0 +1,3 @@ +DBPluginSetName branch +DBPluginSetType property.project +DBPluginSetDatatype string
participants (1)
-
source_changes@macosforge.org