mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-31 21:57:12 +00:00
0a59f74d84
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.
18 lines
292 B
Bash
Executable File
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
|