#!/bin/sh -efu

. gb-sh-functions
. gb-sh-tmpdir

for host in $GB_REPO_MIRRORS; do
	if ! gb-x-rsync-loop -rlt --delete-after ${GB_REPO_RSYNC_ARGS-} "$@" "$GB_REPO_DIR/" "$host:$GB_REPO_DIR/"; then
		stamp_echo >&2 "mirror to $host failed"
		echo 1 >>"$tmpdir"/FAIL
	fi &
done
wait
if [ -s "$tmpdir"/FAIL ]; then
	stamp_echo >&2 "one or more mirrors failed"
#	halt_build_queue
fi
