Index: build.conf =================================================================== --- build.conf +++ build.conf @@ -1,5 +1,5 @@ -# SVN repository -export REPO=svn://svn.freebsd.org/ports +# Git repository +export REPO=https://git.FreeBSD.org/ports.git # tar(1) utility for building tarballs export TAR=`which tar` @@ -7,7 +7,7 @@ # sizes of memory disks export PORTSMDSIZE=500M export SNAPMDSIZE=300M -export JAILMDSIZE=100M +export JAILMDSIZE=5000M export TMPMDSIZE=100M # number of jobs to run in parallel Index: build.sh =================================================================== --- build.sh +++ build.sh @@ -23,12 +23,9 @@ # Record when we're starting SNAPDATE=`date "+%s"` -# Get the latest revision # on the tree -if ! NEWREV=`sh -e s/svn-getrev.sh head`; then - echo "Waiting 5 minutes for svn server to return" - sleep 300 - NEWREV=`sh -e s/svn-getrev.sh head` -fi +# Update and get the latest commit hash +git --git-dir=${STATEDIR}/gitrepo fetch +NEWHASH=`git --git-dir=${STATEDIR}/gitrepo rev-parse HEAD` # Create a memory disk for holding the snapshot files. SNAPMD=`mdconfig -a -t swap -s ${SNAPMDSIZE} -n` @@ -36,7 +33,7 @@ mount -o noatime,noexec,async /dev/md${SNAPMD} ${SNAPDIR} # Build a snapshot -sh -e s/treesnap-build.sh head@${NEWREV} "${DESCRIBES_BUILD}" \ +sh -e s/treesnap-build.sh ${NEWHASH} "${DESCRIBES_BUILD}" \ ${TMPDIR} ${SNAPDIR} # Replace tarballs with "aliased" tarballs @@ -51,7 +48,7 @@ fi # Send emails if INDEX was broken or fixed -sh -e s/describes-warn.sh ${SNAPDIR} ${NEWREV} ${STATEDIR}/describes \ +sh -e s/describes-warn.sh ${SNAPDIR} ${NEWHASH} ${STATEDIR}/describes \ "${DESCRIBES_BUILD}" # Use old DESCRIBE files if the latest ones didn't build Index: releasesnap.sh =================================================================== --- releasesnap.sh +++ releasesnap.sh @@ -16,8 +16,8 @@ # Load configuration . build.conf -# Get the latest revision # on the tree -NEWREV=`sh -e s/svn-getrev.sh ${TREE}` +# Get the latest commit hash on the tree +NEWHASH=`git --git-dir=${STATEDIR}/gitrepo rev-parse HEAD` # Create a memory disk for holding everything which will end up in # /var/db/portsnap. Note that for normal (head) builds we mount the disk @@ -34,7 +34,7 @@ # Build a snapshot SNAPDIR=${STATEDIR}/work/files mkdir ${SNAPDIR} -sh -e s/treesnap-build.sh ${TREE}@${NEWREV} "${DESCRIBES}" ${WORKDIR} ${SNAPDIR} +sh -e s/treesnap-build.sh ${NEWHASH} "${DESCRIBES}" ${WORKDIR} ${SNAPDIR} # Replace tarballs with "aliased" tarballs if ! [ -z ${ALIASFILE} ]; then Index: s/svn-getrev.sh =================================================================== --- s/svn-getrev.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -e - -# No user-serviceable parts -if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then - echo "Do not run $0 manually" - exit 1 -fi - -# usage: sh -e svn-getrev.sh TARGET -TARGET=$1 - -# Get the latest revision # -svn info ${REPO}/${TARGET} | - grep '^Last Changed Rev:' | - cut -f 2 -d : | - cut -f 2 -d ' ' | - grep -E '^[0-9]+$' Index: s/treesnap-build.sh =================================================================== --- s/treesnap-build.sh +++ s/treesnap-build.sh @@ -6,8 +6,8 @@ exit 1 fi -# usage: sh -e treesnap-build.sh TREEREV DESCRIBES WORKDIR SNAPDIR -TREEREV="$1" +# usage: sh -e treesnap-build.sh TREEHASH DESCRIBES WORKDIR SNAPDIR +TREEHASH="$1" DESCRIBES="$2" WORKDIR="$3" SNAP="$4" @@ -26,8 +26,9 @@ mount /dev/md${PORTSMD} ${PORTSDIR} # Export ports tree -echo "`date`: Exporting \"${TREEREV}\" ports tree" -svn export -q --force ${REPO}/${TREEREV} ${PORTSDIR} +echo "`date`: Exporting \"${TREEHASH}\" ports tree" +git --git-dir=${STATEDIR}/gitrepo worktree prune +git --git-dir=${STATEDIR}/gitrepo worktree add ${PORTSDIR} ${TREEHASH} df -i ${PORTSDIR} # Create snapshot Index: setup.sh =================================================================== --- setup.sh +++ setup.sh @@ -56,6 +56,7 @@ Before you can perform Portsnap builds, you need to run keygen.sh to create a signing key. EOF +echo # Create a staging area for files waiting to be uploaded mkdir ${STATEDIR}/stage mkdir ${STATEDIR}/stage/f @@ -63,3 +64,10 @@ mkdir ${STATEDIR}/stage/t mkdir ${STATEDIR}/stage/s +# Clone initial repo in ${STATEDIR}/gitrepo +# In the svn era portsnap performed metadata operations (i.e., finding the +# latest revision number) against the svn server. With git we need a local +# copy of the repository for all operations. Perform an initial clone here, +# which we will update (git fetch) in build.sh and then create worktrees from +# it as needed. +git clone --bare ${REPO} ${STATEDIR}/gitrepo