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