aboutsummaryrefslogtreecommitdiff
blob: 90161ba55b4e260713b629d47da6a558c1f8fa19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# Copyright 2011-2015 Gentoo Foundation; Distributed under the GPL v2
# might be earlier copyright, no history available
ARCHES="alpha amd64 arm hppa ia64      ppc s390 sh sparc x86"
       #alpha amd64 arm hppa ia64 mips ppc s390 sh sparc x86

# The -rp_*asc filter rules causes rsync to only delete .asc files that are in
# directories that would otherwise be deleted.
RSYNC_OPTS="-aO --password-file=/etc/mastermirror-fetch/poseidon-rsync.passwd --delete --delete-delay --timeout=600 --exclude='.*' --filter=-rp_*.asc"

# Do NOT expand the following yet
#_SRC='masterdistfiles@poseidon.amd64.dev.gentoo.org::weekly/${ARCH}/'
#_SRC='masterdistfiles@skimmer.gentoo.org::weekly/${ARCH}/'
_SRC='masterdistfiles@nightheron.gentoo.org::weekly/${ARCH}/'
_DST_BASE='/var/tmp/gmirror-releases/releases/'
# compat
[[ $HOSTNAME == TODO ]] && _DST_BASE='/var/tmp/gmirror/releases/'
[[ -d $_DST_BASE ]] || mkdir $_DST_BASE
# No expansion is IMPORTANT
_DST=${_DST_BASE}/'${ARCH}'/autobuilds

DEBUG=''
VERBOSE=''
# Nothing to edit beyond this point
DEBUGP=
VERBOSEP=
[ -n "$DEBUG" ] && DEBUGP=echo
[ -n "$DEBUG" ] && RSYNC_OPTS="${RSYNC_OPTS} -n"
[ -n "$VERBOSE" ] && RSYNC_OPTS="${RSYNC_OPTS} -v"

for ARCH in $ARCHES ; do
	src="$(eval echo $_SRC)"
	dst="$(eval echo $_DST)"
	prg="$(eval echo $_PRG)"
	$DEBUGP mkdir -pv "$dst"
	rsync ${RSYNC_OPTS} "$src" "$dst"
done