summaryrefslogtreecommitdiff
path: root/Tools/portbuild
diff options
context:
space:
mode:
authorSatoshi Asami <asami@FreeBSD.org>2000-08-29 07:57:09 +0000
committerSatoshi Asami <asami@FreeBSD.org>2000-08-29 07:57:09 +0000
commit0a59f74d84e490ef5f2fddb6cb3d9c80b3ae275f (patch)
tree54a1a7c2f2e0110ee18d0d8baf5d69c988b0e1c4 /Tools/portbuild
parentRemove bak/distfiles after it's done -- this script is now called in (diff)
A small script to copy distfiles from per-port directory to central
location. This is done to avoid write-on-write race conditions, when two package builds try to write the same distfile back into the server. To avoid this, the distfiles are first copied over to distfiles/.pbtmp/${PKGNAME}, and then a .done file is created in that directory. This script runs on the server periodically to copy the files to the central location. Since this script copies one distfile at a time, the race mentioned above doesn't exist. Also, it will only copy files from directories where the .done file exists to avoid read-before-write race conditions.
Notes
Notes: svn path=/head/; revision=32075
Diffstat (limited to 'Tools/portbuild')
-rwxr-xr-xTools/portbuild/scripts/dodistfiles17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tools/portbuild/scripts/dodistfiles b/Tools/portbuild/scripts/dodistfiles
new file mode 100755
index 000000000000..3108b1531732
--- /dev/null
+++ b/Tools/portbuild/scripts/dodistfiles
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+distdir=$1
+while true; do
+ if cd ${distdir}/.pbtmp >/dev/null 2>&1; then
+ set *
+ while [ $# -gt 0 ]; do
+ if [ -e $1/.done ]; then
+ rm -f $1/.done
+ tar -C $1 -cf - . | tar -C ${distdir} -xpf -
+ rm -rf $1
+ fi
+ shift
+ done
+ fi
+ sleep 600
+done