]> asedeno.scripts.mit.edu Git - sipb-mirrors.git/blob - fetch-scripts/fedora-buffet
fedora-buffet: more verbosity
[sipb-mirrors.git] / fetch-scripts / fedora-buffet
1 #!/bin/bash
2
3 set -e
4
5 # This script serves to sync the following modules from fedora-buffet:
6 # - fedora -> ${MIRRORDIR}/fedora
7 # - epel   -> ${MIRRORDIR}/epel
8
9 # To make quick-fedora-mirror happy, it does so through a bind mount,
10 # separate from the symlink farm at ${MIRRORDIR}.
11
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
17 PREBITFLIP=1
18
19 TIMEFILE="${MIRRORDIR}/.locks/fedora-buffet.timefile"
20 QFM="./tools/fedora/quick-fedora-mirror"
21
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
25     # is checked out.
26     echo "Could not find quick-fedora-mirror."
27     exit 1
28 fi
29
30 exittrap() { :; }
31 trap 'exittrap' EXIT
32
33 TMPDIR=$(mktemp -d /tmp/fedora-buffet.XXXXXX) || die "Unable to mktemp"
34 exittrap() { rm -rf "${TMPDIR}"; }
35
36 CONF="${TMPDIR}/qfm.conf"
37 cat >"${CONF}" <<EOF
38 # This will be sourced by qfm, which uses zsh.
39 # Where our mirrors live
40 DESTD=${MIRRORDIR}/fedora-buffet
41 # State regarding last sync, and also a lockfile for qfm
42 TIMEFILE=${TIMEFILE}
43 # Upstream mirror that contains MASTERMODULE
44 REMOTE=${RSYNCSOURCE}
45 MASTERMODULE=${MASTERMODULE}
46 PREBITFLIP=${PREBITFLIP}
47 # Which module to sync
48 MODULES=(fedora epel)
49 # Map from module to location in DESTD
50 MODULEMAPPING=(fedora fedora epel epel)
51 # Add --progress to rsync
52 VERBOSE=7
53 TMPDIR=${TMPDIR}
54 EOF
55
56 "${QFM}" --config "${CONF}" --alwayscheck
57
58 rm -rf "${TMPDIR}"
59 exittrap() { :; }