aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2016-05-27 14:00:23 +0200
committerAlex Legler <alex@a3li.li>2016-05-27 14:00:45 +0200
commitdcaba6a3d14c9ec4b6424c304ddd7e99aec71235 (patch)
treeedc19459d5372a4bd5ee521e0ffb5826b9ac142a /bin
parentRemove debug code (diff)
downloadwww-dcaba6a3d14c9ec4b6424c304ddd7e99aec71235.tar.gz
www-dcaba6a3d14c9ec4b6424c304ddd7e99aec71235.tar.bz2
www-dcaba6a3d14c9ec4b6424c304ddd7e99aec71235.zip
Whitespace
Diffstat (limited to 'bin')
-rwxr-xr-xbin/update-downloads.sh77
1 files changed, 39 insertions, 38 deletions
diff --git a/bin/update-downloads.sh b/bin/update-downloads.sh
index 3b0b894..b113fdb 100755
--- a/bin/update-downloads.sh
+++ b/bin/update-downloads.sh
@@ -6,75 +6,76 @@ URI_BASE="http://distfiles.gentoo.org/releases"
ARCHES=(alpha amd64 arm hppa ia64 mips ppc s390 sh sparc x86)
usage() {
- cat <<EOF
+ cat <<EOF
Usage: update-downloads.sh
Helper script that runs on the servers to refresh the files that back the
downloads page: https://gentoo.org/downloads/
EOF
- exit 0
+ exit 0
}
fetch() {
- wget -T 60 -q "$@"
+ wget -T 60 -q "$@"
}
# Append extra images to the specified list.
# append_list <local file> <list of remote urls to append>
append_list() {
- local list=$1 file
- shift
- for file in "$@" ; do
- fetch -O - >>"${list}" "${uri_base}/${file}"
- done
+ local list=$1 file
+ shift
+ for file in "$@"; do
+ fetch -O - >>"${list}" "${uri_base}/${file}"
+ done
}
update_amd64() {
- append_list "${boot_list}" "latest-admincd-amd64.txt"
+ append_list "${boot_list}" "latest-admincd-amd64.txt"
}
update_hppa() {
- append_list "${boot_list}" latest-netboot-hppa{32,64}.txt
+ append_list "${boot_list}" latest-netboot-hppa{32,64}.txt
}
update_s390() {
- append_list "${boot_list}" latest-netboot-s390{,x}-{initramfs,kernel}.txt
+ append_list "${boot_list}" latest-netboot-s390{,x}-{initramfs,kernel}.txt
}
update_x86() {
- append_list "${boot_list}" "latest-admincd-x86.txt"
+ append_list "${boot_list}" "latest-admincd-x86.txt"
}
# Update the bootable & stage lists.
update_arch() {
- local arch=$1
- local uri_base="${URI_BASE}/${arch}/autobuilds"
- local list_base="_data/downloads/${arch}"
- local boot_list="${list_base}/iso.txt"
- local stage_list="${list_base}/stage3.txt"
-
- mkdir -p "${list_base}"
- fetch "${uri_base}/latest-iso.txt" -O "${boot_list}"
- fetch "${uri_base}/latest-stage3.txt" -O "${stage_list}"
- if [[ $(type -t "update_${arch}") == "function" ]] ; then
- update_${arch}
- fi
+ local arch=$1
+ local uri_base="${URI_BASE}/${arch}/autobuilds"
+ local list_base="_data/downloads/${arch}"
+ local boot_list="${list_base}/iso.txt"
+ local stage_list="${list_base}/stage3.txt"
+
+ mkdir -p "${list_base}"
+ fetch "${uri_base}/latest-iso.txt" -O "${boot_list}"
+ fetch "${uri_base}/latest-stage3.txt" -O "${stage_list}"
+ if [[ $(type -t "update_${arch}") == "function" ]]; then
+ update_${arch}
+ fi
}
main() {
- if [[ $# -ne 0 ]] ; then
- usage
- fi
-
- # Make sure we're in the top level dir.
- cd "$(dirname "$0")"/..
-
- local arch
- printf 'Updating ... '
- for arch in "${ARCHES[@]}" ; do
- printf '%s ' "${arch}"
- update_arch "${arch}"
- done
- echo '... done'
+ if [[ $# -ne 0 ]]; then
+ usage
+ fi
+
+ # Make sure we're in the top level dir.
+ cd "$(dirname "$0")"/..
+
+ local arch
+ printf 'Updating downloads... '
+ for arch in "${ARCHES[@]}"; do
+ printf '%s ' "${arch}"
+ update_arch "${arch}"
+ done
+ echo 'done.'
}
+
main "$@"