diff options
author | 2016-03-20 17:10:47 -0400 | |
---|---|---|
committer | 2016-03-23 11:38:33 +0000 | |
commit | 4331da49ba9e6cdea166be5b6385e72d76f4d3d6 (patch) | |
tree | c9e5411aa67d047fd18f9146104912ea88cfadce | |
parent | copy_buildsync.sh: convert code to use arrays (diff) | |
download | releng-4331da49ba9e6cdea166be5b6385e72d76f4d3d6.tar.gz releng-4331da49ba9e6cdea166be5b6385e72d76f4d3d6.tar.bz2 releng-4331da49ba9e6cdea166be5b6385e72d76f4d3d6.zip |
copy_buildsync.sh: convert code to use funcs
This makes the code a bit easier to follow and break up.
-rwxr-xr-x | scripts/copy_buildsync.sh | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/scripts/copy_buildsync.sh b/scripts/copy_buildsync.sh index d70c228d..922fbb5b 100755 --- a/scripts/copy_buildsync.sh +++ b/scripts/copy_buildsync.sh @@ -34,7 +34,21 @@ VERBOSEP= [ -n "$VERBOSE" ] && RSYNC_OPTS+=( -v ) [ -n "$VERBOSEP" ] && VERBOSEP="-v" -for ARCH in "${ARCHES[@]}"; do +usage() { + cat <<EOF +Usage: $0 + +Move releases from the incoming upload directory to the outgoing release +directory so they can be pushed out to mirrors. +Also update the "latest" links/files so people can easily find the current +version for any particular arch/release. +EOF + exit 1 +} + +process_arch() { + local ARCH=$1 + rc=0 fail=0 @@ -147,7 +161,18 @@ for ARCH in "${ARCHES[@]}"; do else echo "There was some failure for $ARCH during the weekly sync. Not doing cleanup for fear of dataloss." 1>&2 fi +} -done +main() { + if [[ $# -ne 0 ]]; then + usage + fi + + local arch + for arch in "${ARCHES[@]}"; do + process_arch "${arch}" + done +} +main "$@" # vim:ts=2 sw=2 noet ft=sh: |