Changeset View
Changeset View
Standalone View
Standalone View
releasesnap.sh
Show All 10 Lines | |||||
if [ -z "${TREE}" ] || [ -z "${DESCRIBES}" ] || [ -z "${TARBALL}" ]; then | if [ -z "${TREE}" ] || [ -z "${DESCRIBES}" ] || [ -z "${TARBALL}" ]; then | ||||
echo "usage: sh -e releasesnap.sh TREE DESCRIBES TARBALL" | echo "usage: sh -e releasesnap.sh TREE DESCRIBES TARBALL" | ||||
exit 1 | exit 1 | ||||
fi | fi | ||||
# Load configuration | # Load configuration | ||||
. build.conf | . build.conf | ||||
# Get the latest revision # on the tree | # Get the latest commit hash on the tree | ||||
NEWREV=`sh -e s/svn-getrev.sh ${TREE}` | NEWHASH=`git --git-dir=${STATEDIR}/gitrepo rev-parse HEAD` | ||||
emaste: Probably need `git --git-dir=${STATEDIR}/gitrepo fetch` first here too | |||||
Done Inline ActionsAdded locally now emaste: Added locally now | |||||
# Create a memory disk for holding everything which will end up in | # 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 | # /var/db/portsnap. Note that for normal (head) builds we mount the disk | ||||
# on ${SNAPDIR}; we can't do that here because we want everything to be on | # on ${SNAPDIR}; we can't do that here because we want everything to be on | ||||
# a single filesystem so that hardlinks work. | # a single filesystem so that hardlinks work. | ||||
SNAPMD=`mdconfig -a -t swap -s ${SNAPMDSIZE} -n` | SNAPMD=`mdconfig -a -t swap -s ${SNAPMDSIZE} -n` | ||||
newfs -O 1 -n /dev/md${SNAPMD} >/dev/null | newfs -O 1 -n /dev/md${SNAPMD} >/dev/null | ||||
# Mount the memory disk | # Mount the memory disk | ||||
WORKDIR=${STATEDIR}/work | WORKDIR=${STATEDIR}/work | ||||
mkdir ${WORKDIR} | mkdir ${WORKDIR} | ||||
mount -onoatime,async /dev/md${SNAPMD} ${WORKDIR} | mount -onoatime,async /dev/md${SNAPMD} ${WORKDIR} | ||||
# Build a snapshot | # Build a snapshot | ||||
SNAPDIR=${STATEDIR}/work/files | SNAPDIR=${STATEDIR}/work/files | ||||
mkdir ${SNAPDIR} | 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 | # Replace tarballs with "aliased" tarballs | ||||
if ! [ -z ${ALIASFILE} ]; then | if ! [ -z ${ALIASFILE} ]; then | ||||
sh -e s/alias-all.sh ${SNAPDIR} ${STATEDIR}/fileset/oldfiles \ | sh -e s/alias-all.sh ${SNAPDIR} ${STATEDIR}/fileset/oldfiles \ | ||||
${ALIASFILE} ${WORKDIR} | ${ALIASFILE} ${WORKDIR} | ||||
fi | fi | ||||
# Make sure we have the required describe files | # Make sure we have the required describe files | ||||
Show All 26 Lines |
Probably need git --git-dir=${STATEDIR}/gitrepo fetch first here too