aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorMark Linimon <linimon@FreeBSD.org>2010-06-25 23:42:51 +0000
committerMark Linimon <linimon@FreeBSD.org>2010-06-25 23:42:51 +0000
commit90089c9f170ac854ab315f6f376b372f0d7fd35c (patch)
tree7accd1606ede782e88713b43ed2032a874c05ace /Tools
parent2fe59a537a0a0321193642b9bbdefb2aea98d4b5 (diff)
downloadports-90089c9f170ac854ab315f6f376b372f0d7fd35c.tar.gz
ports-90089c9f170ac854ab315f6f376b372f0d7fd35c.zip
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/updatesnap76
-rwxr-xr-xTools/portbuild/scripts/updatesnap.ports23
2 files changed, 37 insertions, 62 deletions
diff --git a/Tools/portbuild/scripts/updatesnap b/Tools/portbuild/scripts/updatesnap
index 906a9cf82d4d..2fc9ccef63b4 100755
--- a/Tools/portbuild/scripts/updatesnap
+++ b/Tools/portbuild/scripts/updatesnap
@@ -3,14 +3,16 @@
# Update the master source trees that are used by package builds
# and other consumers
-# head is handled specially
-HEAD_BRANCH="9"
-NON_HEAD_BRANCHES=""
+pb=/var/portbuild
+. ${pb}/conf/server.conf
-base=/a/snap
-zbase=a/snap
+base=${ZFS_MOUNTPOINT}/${SNAP_SRC_DIRECTORY_PREFIX}
+zbase=${ZFS_VOLUME}/${SNAP_SRC_DIRECTORY_PREFIX}
-srepo=/r/ncvs
+supstamp() {
+ fulldate=$1
+ date -j -f %+ "${fulldate}" +%Y.%m.%d.%H.%M.%S
+}
stamp() {
fulldate=$1
@@ -33,50 +35,22 @@ echo "Started at $(date)"
# We need to preserve group writability so portmgr group can write
umask 002
-#cvsup -g /root/cvs-supfile || finish 1
-
-cd $base/src-${HEAD_BRANCH}
-fulldate=$(date)
-cvs -Rq -d ${srepo} update -PdA -D "${fulldate}"
-echo ${fulldate} > cvsdone
-snapdate=$(stamp ${fulldate})
-zfs snapshot ${zbase}/src-${HEAD_BRANCH}@${snapdate}
-
-# XXX
-# Special casing for 6 and 8 to test building against .0 src ABI
-# This requires some remodelling after we're done with all branches
-# XXX
-
-cd $base/src-6
-fulldate=$(date)
-cvs -Rq -d ${srepo} update -PdA -D "${fulldate}" -r RELENG_6_4
-echo ${fulldate} > cvsdone
-snapdate=$(stamp ${fulldate})
-zfs snapshot ${zbase}/src-6@${snapdate}
-
-cd $base/src-7
-fulldate=$(date)
-cvs -Rq -d ${srepo} update -PdA -D "${fulldate}" -r RELENG_7_1
-echo ${fulldate} > cvsdone
-snapdate=$(stamp ${fulldate})
-zfs snapshot ${zbase}/src-7@${snapdate}
-
-cd $base/src-8
-fulldate=$(date)
-cvs -Rq -d ${srepo} update -PdA -D "${fulldate}" -r RELENG_8_0
-echo ${fulldate} > cvsdone
-snapdate=$(stamp ${fulldate})
-zfs snapshot ${zbase}/src-8@${snapdate}
-
-# EO XXX
-
-#for branch in $NON_HEAD_BRANCHES; do
-# cd $base/src-${branch}
-# fulldate=$(date)
-# cvs -Rq -d ${srepo} update -PdA -D "${fulldate}" -r RELENG_${branch}
-# echo ${fulldate} > cvsdone
-# snapdate=$(stamp ${fulldate})
-# zfs snapshot ${zbase}/src-${branch}@${snapdate}
-#done
+# for branch in 8; do
+for branch in $SRC_BRANCHES; do
+ cd ${base}${branch}
+ fulldate=$(date)
+ supdate=$(supstamp ${fulldate})
+ eval tag=\$SRC_BRANCH_${branch}_TAG
+ cat ${SRC_MASTER_SUPFILE} | \
+ sed "s|%%DATE%%|${supdate}|;s|%%PREFIX%%|${base}${branch}|;s|%%TAG%%|${tag}|" \
+ > ${SRC_SUPFILE}.${branch}.now
+ # example destination directory: /a/snap/src-6/src/ (tricky!)
+ csup -L 2 ${SRC_SUPFILE}.${branch}.now > src-csup.${branch}.log
+ echo ${fulldate} > src/.updated
+ # hack for zfs breakiness
+ find . -group wheel|xargs chgrp portmgr
+ snapdate=$(stamp ${fulldate})
+ zfs snapshot ${zbase}${branch}/src@${snapdate}
+done
finish 0
diff --git a/Tools/portbuild/scripts/updatesnap.ports b/Tools/portbuild/scripts/updatesnap.ports
index c2dd4ae23a74..81a928d87672 100755
--- a/Tools/portbuild/scripts/updatesnap.ports
+++ b/Tools/portbuild/scripts/updatesnap.ports
@@ -3,10 +3,11 @@
# Update the master ports tree that is used by package builds
# and other consumers
-base=/a/snap
-zbase=a/snap
+pb=/var/portbuild
+. ${pb}/conf/server.conf
-prepo=/r/pcvs
+base=${ZFS_MOUNTPOINT}/${SNAP_PORTS_DIRECTORY}
+zbase=${ZFS_VOLUME}/${SNAP_PORTS_DIRECTORY}
supstamp() {
fulldate=$1
@@ -34,17 +35,17 @@ echo "Started at $(date)"
# We need to preserve group writability so portmgr group can write
umask 002
-#cvsup -g /root/cvs-supfile || finish 1
-
+cd ${base}
fulldate=$(date)
supdate=$(supstamp ${fulldate})
-
-cat /root/ports-cvsup-master-supfile | sed "s|%%DATE%%|${supdate}|" > /root/ports-cvsup-master-supfile.now
-
-cvsup -L 2 /root/ports-cvsup-master-supfile.now > ${base}/ports/cvsup.log
-echo ${fulldate} > /a/snap/ports/cvsdone
+cat ${PORTS_MASTER_SUPFILE} | \
+ sed "s|%%DATE%%|${supdate}|;s|%%PREFIX%%|${base}|" \
+ > ${PORTS_SUPFILE}.now
+# example destination directory: /a/snap/ports-head/ports/
+csup -L 2 ${PORTS_SUPFILE}.now > ports-csup.log
+echo ${fulldate} > ports/.updated
# hack for zfs breakiness
-find ${base}/ports -group wheel|xargs chgrp portmgr
+find . -group wheel|xargs chgrp portmgr
snapdate=$(stamp ${fulldate})
zfs snapshot ${zbase}/ports@${snapdate}