aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorMark Linimon <linimon@FreeBSD.org>2009-11-09 08:37:36 +0000
committerMark Linimon <linimon@FreeBSD.org>2009-11-09 08:37:36 +0000
commit920334487530b09387d210c192bb3f5e818feed9 (patch)
tree95ab1f78e5c4d15604cd5bfc19b44b9a9a96591d /Tools
parent32c081c9e6e4d5843c71921ad9f4b9d9cb774369 (diff)
downloadports-920334487530b09387d210c192bb3f5e818feed9.tar.gz
ports-920334487530b09387d210c192bb3f5e818feed9.zip
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/build41
1 files changed, 36 insertions, 5 deletions
diff --git a/Tools/portbuild/scripts/build b/Tools/portbuild/scripts/build
index 0afd92efb818..c852f9b05077 100755
--- a/Tools/portbuild/scripts/build
+++ b/Tools/portbuild/scripts/build
@@ -45,11 +45,21 @@ do_create() {
builddir=$4
shift 4
- zfs create -o mountpoint=${builddir} a/portbuild/${arch}/${branch}/${buildid} \
- || (echo "Couldn't create build"; exit 1)
+ newfs=a/portbuild/${arch}/${buildid}
+ zfs create -o mountpoint=${builddir} ${newfs} || exit 1
+ zfs snapshot ${newfs}@${buildid}
- echo "New build ID is ${buildid}"
+ portsfs=${newfs}/ports
+ portsnap=${portsfs}@${buildid}
+ zfs create -o mountpoint=${builddir}/ports ${portsfs} || exit 1
+ zfs snapshot ${portsnap}
+
+ srcfs=${newfs}/src
+ srcsnap=${srcfs}@${buildid}
+ zfs create -o mountpoint=${builddir}/src ${srcfs} || exit 1
+ zfs snapshot ${srcsnap}
+ echo "New build ID is ${buildid}"
}
do_clone() {
@@ -439,6 +449,16 @@ if [ $# -ge 1 ]; then
# We can't rely on buildenv for this code path
fi
;;
+ create)
+ # XXX some way to avoid the latest/previous dance?
+ if [ "${buildid}" = "latest" ]; then
+ buildid=$(now)
+ elif [ "${buildid}" = "previous" ]; then
+ echo "Use build clone latest instead"
+ exit 1
+ fi
+ # We can't rely on buildenv for this code path
+ ;;
*)
newbuildid=$(resolve ${pb} ${arch} ${branch} ${buildid})
if [ -z "${newbuildid}" ]; then
@@ -463,10 +483,21 @@ case "$cmd" in
do_list ${arch} ${branch} $@
;;
create)
+ # XXX some way to avoid the latest/previous dance?
if [ -z "${buildid}" ]; then
buildid=$(now)
- usage
+ else
+ buildid=${buildid%/}
fi
+
+ # note: the directory must not exist yet
+ builddir=$(realpath ${pbab}/builds)/${buildid}/
+ if [ -d ${builddir} ]; then
+ echo "Can't create ${builddir}, it already exists"
+ exit 1
+ fi
+ buildenv ${pb} ${arch} ${branch} ${builddir}
+
proxy_root create ${arch} ${branch} ${buildid} ${builddir} $@
;;
clone)
@@ -507,7 +538,7 @@ case "$cmd" in
proxy_root destroy ${arch} ${branch} ${buildid} ${builddir} $@
;;
*)
- echo "Invalid command: $cmd"
+ echo "build: invalid command: $cmd"
exit 1
;;
esac