diff options
author | Satoshi Asami <asami@FreeBSD.org> | 2000-08-29 07:57:09 +0000 |
---|---|---|
committer | Satoshi Asami <asami@FreeBSD.org> | 2000-08-29 07:57:09 +0000 |
commit | 0a59f74d84e490ef5f2fddb6cb3d9c80b3ae275f (patch) | |
tree | 54a1a7c2f2e0110ee18d0d8baf5d69c988b0e1c4 /Tools | |
parent | 8dc4353d1bae7df07ad4343c0b9bfd13d6c58536 (diff) | |
download | freebsd-ports-0a59f74d84e490ef5f2fddb6cb3d9c80b3ae275f.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')
-rwxr-xr-x | Tools/portbuild/scripts/dodistfiles | 17 |
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 |