1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-29 21:39:24 +00:00
freebsd-ports/Tools/portbuild/scripts/dodistfiles
Satoshi Asami 0a59f74d84 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.
2000-08-29 07:57:09 +00:00

18 lines
292 B
Bash
Executable File

#!/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