]> asedeno.scripts.mit.edu Git - sipb-mirrors.git/blob - fetch-scripts/fedora-buffet
fedora-buffet: switch upstreams again
[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 RSYNCSOURCE=rsync://dl.fedoraproject.org
14 MASTERMODULE=fedora-buffet0
15 PREBITFLIP=1
16
17 TIMEFILE="${MIRRORDIR}/.locks/fedora-buffet.timefile"
18 QFM="./tools/fedora/quick-fedora-mirror"
19
20 if ! [ -x "${QFM}" ]; then
21     # It is expected that this script is sourced by fetch-hudson
22     # and that cwd is the workspace where the root of this repository
23     # is checked out.
24     echo "Could not find quick-fedora-mirror."
25     exit 1
26 fi
27
28 exittrap() { :; }
29 trap 'exittrap' EXIT
30
31 TMPDIR=$(mktemp -d /tmp/fedora-buffet.XXXXXX) || die "Unable to mktemp"
32 exittrap() { rm -rf "${TMPDIR}"; }
33
34 CONF="${TMPDIR}/qfm.conf"
35 cat >"${CONF}" <<EOF
36 # This will be sourced by qfm, which uses zsh.
37 # Where our mirrors live
38 DESTD=${MIRRORDIR}/fedora-buffet
39 # State regarding last sync, and also a lockfile for qfm
40 TIMEFILE=${TIMEFILE}
41 # Upstream mirror that contains MASTERMODULE
42 REMOTE=${RSYNCSOURCE}
43 MASTERMODULE=${MASTERMODULE}
44 PREBITFLIP=${PREBITFLIP}
45 # Which module to sync
46 MODULES=(fedora epel)
47 # Map from module to location in DESTD
48 MODULEMAPPING=(fedora fedora epel epel)
49 # One -v to rsync
50 VERBOSE=4
51 TMPDIR=${TMPDIR}
52 EOF
53
54 "${QFM}" --config "${CONF}" --alwayscheck
55
56 rm -rf "${TMPDIR}"
57 exittrap() { :; }