aboutsummaryrefslogtreecommitdiffstats
path: root/Tools/portbuild
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>2000-08-29 15:57:09 +0800
committerasami <asami@FreeBSD.org>2000-08-29 15:57:09 +0800
commitd40dbda1c407584db8497e08241bd96316730fd6 (patch)
treec3f80fcb88e4e3e71b26d1ac6ee646db6caacfbd /Tools/portbuild
parent7441da1e6a920ccd16753513d5f03b74623b53a8 (diff)
downloadfreebsd-ports-gnome-d40dbda1c407584db8497e08241bd96316730fd6.tar.gz
freebsd-ports-gnome-d40dbda1c407584db8497e08241bd96316730fd6.tar.zst
freebsd-ports-gnome-d40dbda1c407584db8497e08241bd96316730fd6.zip
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.
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