Gentoo Archives: gentoo-commits

From: Alex Legler <a3li@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] sites/www:master commit in: bin/
Date: Fri, 27 May 2016 12:07:26
Message-Id: 1464350445.dcaba6a3d14c9ec4b6424c304ddd7e99aec71235.a3li@gentoo
1 commit: dcaba6a3d14c9ec4b6424c304ddd7e99aec71235
2 Author: Alex Legler <alex <AT> a3li <DOT> li>
3 AuthorDate: Fri May 27 12:00:23 2016 +0000
4 Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
5 CommitDate: Fri May 27 12:00:45 2016 +0000
6 URL: https://gitweb.gentoo.org/sites/www.git/commit/?id=dcaba6a3
7
8 Whitespace
9
10 bin/update-downloads.sh | 77 +++++++++++++++++++++++++------------------------
11 1 file changed, 39 insertions(+), 38 deletions(-)
12
13 diff --git a/bin/update-downloads.sh b/bin/update-downloads.sh
14 index 3b0b894..b113fdb 100755
15 --- a/bin/update-downloads.sh
16 +++ b/bin/update-downloads.sh
17 @@ -6,75 +6,76 @@ URI_BASE="http://distfiles.gentoo.org/releases"
18 ARCHES=(alpha amd64 arm hppa ia64 mips ppc s390 sh sparc x86)
19
20 usage() {
21 - cat <<EOF
22 + cat <<EOF
23 Usage: update-downloads.sh
24
25 Helper script that runs on the servers to refresh the files that back the
26 downloads page: https://gentoo.org/downloads/
27 EOF
28 - exit 0
29 + exit 0
30 }
31
32 fetch() {
33 - wget -T 60 -q "$@"
34 + wget -T 60 -q "$@"
35 }
36
37 # Append extra images to the specified list.
38 # append_list <local file> <list of remote urls to append>
39 append_list() {
40 - local list=$1 file
41 - shift
42 - for file in "$@" ; do
43 - fetch -O - >>"${list}" "${uri_base}/${file}"
44 - done
45 + local list=$1 file
46 + shift
47 + for file in "$@"; do
48 + fetch -O - >>"${list}" "${uri_base}/${file}"
49 + done
50 }
51
52 update_amd64() {
53 - append_list "${boot_list}" "latest-admincd-amd64.txt"
54 + append_list "${boot_list}" "latest-admincd-amd64.txt"
55 }
56
57 update_hppa() {
58 - append_list "${boot_list}" latest-netboot-hppa{32,64}.txt
59 + append_list "${boot_list}" latest-netboot-hppa{32,64}.txt
60 }
61
62 update_s390() {
63 - append_list "${boot_list}" latest-netboot-s390{,x}-{initramfs,kernel}.txt
64 + append_list "${boot_list}" latest-netboot-s390{,x}-{initramfs,kernel}.txt
65 }
66
67 update_x86() {
68 - append_list "${boot_list}" "latest-admincd-x86.txt"
69 + append_list "${boot_list}" "latest-admincd-x86.txt"
70 }
71
72 # Update the bootable & stage lists.
73 update_arch() {
74 - local arch=$1
75 - local uri_base="${URI_BASE}/${arch}/autobuilds"
76 - local list_base="_data/downloads/${arch}"
77 - local boot_list="${list_base}/iso.txt"
78 - local stage_list="${list_base}/stage3.txt"
79 -
80 - mkdir -p "${list_base}"
81 - fetch "${uri_base}/latest-iso.txt" -O "${boot_list}"
82 - fetch "${uri_base}/latest-stage3.txt" -O "${stage_list}"
83 - if [[ $(type -t "update_${arch}") == "function" ]] ; then
84 - update_${arch}
85 - fi
86 + local arch=$1
87 + local uri_base="${URI_BASE}/${arch}/autobuilds"
88 + local list_base="_data/downloads/${arch}"
89 + local boot_list="${list_base}/iso.txt"
90 + local stage_list="${list_base}/stage3.txt"
91 +
92 + mkdir -p "${list_base}"
93 + fetch "${uri_base}/latest-iso.txt" -O "${boot_list}"
94 + fetch "${uri_base}/latest-stage3.txt" -O "${stage_list}"
95 + if [[ $(type -t "update_${arch}") == "function" ]]; then
96 + update_${arch}
97 + fi
98 }
99
100 main() {
101 - if [[ $# -ne 0 ]] ; then
102 - usage
103 - fi
104 -
105 - # Make sure we're in the top level dir.
106 - cd "$(dirname "$0")"/..
107 -
108 - local arch
109 - printf 'Updating ... '
110 - for arch in "${ARCHES[@]}" ; do
111 - printf '%s ' "${arch}"
112 - update_arch "${arch}"
113 - done
114 - echo '... done'
115 + if [[ $# -ne 0 ]]; then
116 + usage
117 + fi
118 +
119 + # Make sure we're in the top level dir.
120 + cd "$(dirname "$0")"/..
121 +
122 + local arch
123 + printf 'Updating downloads... '
124 + for arch in "${ARCHES[@]}"; do
125 + printf '%s ' "${arch}"
126 + update_arch "${arch}"
127 + done
128 + echo 'done.'
129 }
130 +
131 main "$@"