5 # This script serves to sync the following modules from fedora-buffet:
6 # - fedora -> ${MIRRORDIR}/fedora
7 # - epel -> ${MIRRORDIR}/epel
9 # To make quick-fedora-mirror happy, it does so through a bind mount,
10 # separate from the symlink farm at ${MIRRORDIR}.
12 # mirrors.mit.edu is on the IP ACL for fedora-buffet0 here
13 # so we'll use it. Adjust these values if switching upstreams.
14 #RSYNCSOURCE=rsync://download-i2.fedoraproject.org
15 RSYNCSOURCE=rsync://dl.fedoraproject.org
16 MASTERMODULE=fedora-buffet0
19 TIMEFILE="${MIRRORDIR}/.locks/fedora-buffet.timefile"
20 QFM="./tools/fedora/quick-fedora-mirror"
22 if ! [ -x "${QFM}" ]; then
23 # It is expected that this script is sourced by fetch-hudson
24 # and that cwd is the workspace where the root of this repository
26 echo "Could not find quick-fedora-mirror."
30 # Early ownership checks for bind-mounted target directories.
32 for dir in epel fedora; do
33 check_target="${MIRRORDIR}/fedora-buffet/${dir}"
34 if ! [ -O "${check_target}" ]; then
35 echo "${check_target} ownership is wrong; is the bind mount missing?"
39 if [ -n "${exit_early}" ]; then
46 TMPDIR=$(mktemp -d /tmp/fedora-buffet.XXXXXX) || die "Unable to mktemp"
47 exittrap() { rm -rf "${TMPDIR}"; }
49 CONF="${TMPDIR}/qfm.conf"
51 # This will be sourced by qfm, which uses zsh.
52 # Where our mirrors live
53 DESTD=${MIRRORDIR}/fedora-buffet
54 # State regarding last sync, and also a lockfile for qfm
56 # Upstream mirror that contains MASTERMODULE
58 MASTERMODULE=${MASTERMODULE}
59 PREBITFLIP=${PREBITFLIP}
60 # Which module to sync
62 # Map from module to location in DESTD
63 MODULEMAPPING=(fedora fedora epel epel)
64 # Add --progress to rsync
69 "${QFM}" --config "${CONF}" --alwayscheck