summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2020-05-08 15:41:36 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2020-05-08 15:41:36 -0700
commit9dc7dcc74a493c5259417912eeaa2bc72601a2f1 (patch)
treeaae142561cd2e3f90e6231eb8263258ec552ecc9 /sync-autobuilds.sh
parentmastermirror-staging: use newer git-restore-mtime (diff)
downloadmastermirror-scripts-9dc7dcc74a493c5259417912eeaa2bc72601a2f1.tar.gz
mastermirror-scripts-9dc7dcc74a493c5259417912eeaa2bc72601a2f1.tar.bz2
mastermirror-scripts-9dc7dcc74a493c5259417912eeaa2bc72601a2f1.zip
sync-autobuilds.sh: cleanup script
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'sync-autobuilds.sh')
-rwxr-xr-xsync-autobuilds.sh26
1 files changed, 17 insertions, 9 deletions
diff --git a/sync-autobuilds.sh b/sync-autobuilds.sh
index 9294cd4..8f46b38 100755
--- a/sync-autobuilds.sh
+++ b/sync-autobuilds.sh
@@ -1,12 +1,21 @@
-#!/bin/sh
-# Copyright 2011-2015 Gentoo Foundation; Distributed under the GPL v2
+#!/bin/bash
+# Copyright 2011-2020 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 --no-motd"
+RSYNC_OPTS=(
+ -aO
+ --password-file=/etc/mastermirror-fetch/poseidon-rsync.passwd
+ --delete
+ --delete-delay
+ --timeout=600
+ --exclude='.*'
+ --filter=-rp_*.asc
+ --no-motd
+)
# Do NOT expand the following yet
#_SRC='masterdistfiles@poseidon.amd64.dev.gentoo.org::weekly/${ARCH}/'
@@ -25,18 +34,17 @@ VERBOSE=''
# Nothing to edit beyond this point
DEBUGP=
VERBOSEP=
-[ -n "$DEBUG" ] && DEBUGP=echo
-[ -n "$DEBUG" ] && RSYNC_OPTS="${RSYNC_OPTS} -n"
+[ -n "$DEBUG" ] && DEBUGP="echo"
+[ -n "$DEBUG" ] && RSYNC_OPTS+=( -n )
if [ -n "$VERBOSE" ]; then
- RSYNC_OPTS="${RSYNC_OPTS} -v"
+ RSYNC_OPTS+=( -v )
else
- RSYNC_OPTS="${RSYNC_OPTS} -q"
+ RSYNC_OPTS+=( -q )
fi
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"
+ rsync "${RSYNC_OPTS[@]}" "$src" "$dst"
done