]> asedeno.scripts.mit.edu Git - sipb-mirrors.git/blob - fetch-scripts/fedora-buffet
Revert "fedora and fedora-epel: abusing DESTD to limit scope and hopefully appease rsync"
[sipb-mirrors.git] / fetch-scripts / fedora-buffet
1 #!/bin/bash
2
3 # This script serves to sync the following modules from fedora-buffet:
4 # - fedora -> ${MIRRORDIR}/fedora
5 # - epel   -> ${MIRRORDIR}/epel
6
7 # To make quick-fedora-mirror happy, it does so through a bind mount,
8 # separate from the symlink farm at ${MIRRORDIR}.
9
10 # mirrors.mit.edu is on the IP ACL for fedora-buffet0 here
11 # so we'll use it. Adjust these values if switching upstreams.
12 RSYNCSOURCE=rsync://download-i2.fedoraproject.org
13 MASTERMODULE=fedora-buffet0
14 PREBITFLIP=1
15
16 TIMEFILE="${MIRRORDIR}/.locks/fedora-buffet.timefile"
17 QFM="./tools/fedora/quick-fedora-mirror"
18
19 if ! [ -x "${QFM}" ]; then
20     # It is expected that this script is sourced by fetch-hudson
21     # and that cwd is the workspace where the root of this repository
22     # is checked out.
23     echo "Could not find quick-fedora-mirror."
24     exit 1
25 fi
26
27 exittrap() { :; }
28 trap 'exittrap' EXIT
29
30 TMPDIR=$(mktemp -d /tmp/fedora.XXXXXX) || die "Unable to mktemp"
31 exittrap() { rm -rf "${TMPDIR}"; }
32
33 CONF="${TMPDIR}/qfm.conf"
34 cat >"${CONF}" <<EOF
35 # This will be sourced by qfm, which uses zsh.
36 # Where our mirrors live
37 DESTD=${MIRRORDIR}/.fedora-buffet
38 # State regarding last sync, and also a lockfile for qfm
39 TIMEFILE=${TIMEFILE}
40 # Upstream mirror that contains MASTERMODULE
41 REMOTE=${RSYNCSOURCE}
42 MASTERMODULE=${MASTERMODULE}
43 PREBITFLIP=${PREBITFLIP}
44 # Which module to sync
45 MODULES=(fedora epel)
46 # Map from module to location in DESTD
47 MODULEMAPPING=(fedora fedora epel epel)
48 # One -v to rsync
49 VERBOSE=4
50 TMPDIR=${TMPDIR}
51 EOF
52
53 "${QFM}" --config "${CONF}"
54
55 rm -rf "${TMPDIR}"
56 exittrap() { :; }