summaryrefslogtreecommitdiff
path: root/update-website
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-08-09 09:27:22 +0200
committerErich Eckner <git@eckner.net>2017-08-09 09:27:22 +0200
commit0231e3c70e8c5261e2c4c6c142a653043880cbd5 (patch)
tree83b54cd202278cb4756720065b4eabca6a5126ea /update-website
parentda391bc821753927cd566832b28099c8e1888dae (diff)
downloadbuild-arch-iso-0231e3c70e8c5261e2c4c6c142a653043880cbd5.tar.xz
kann jetzt auch die Mirrorlist auf der Downloadseite updaten
Diffstat (limited to 'update-website')
-rwxr-xr-xupdate-website58
1 files changed, 58 insertions, 0 deletions
diff --git a/update-website b/update-website
index 0357afa..d588db0 100755
--- a/update-website
+++ b/update-website
@@ -14,6 +14,64 @@ cleanup() {
}
trap cleanup EXIT
+(
+ printf ' <div id="download-mirrors">\n'
+ curl -Ss 'https://raw.githubusercontent.com/archlinux32/packages/master/core/pacman-mirrorlist/mirrorlist?'"$(
+ head -c 24 /dev/urandom | \
+ base64 -w0
+ )" | \
+ sed '
+ 0,/^$/d
+ /^$/d
+ /^## /{
+ s|^## |\n </ul>\n\n <h5>|
+ s|$|</h5>\n\n <ul>\n|
+ '"$(
+ while read -r flag country; do
+ printf \
+ 's|<h5>%s</h5>|<h5><span class="fam-flag fam-flag-%s" title="%s"></span> %s</h5>|\n' \
+ "${country}" \
+ "${flag}" \
+ "${country}" \
+ "${country}"
+ done < \
+ "${0%/*}/flag-names"
+ )"'
+ }
+ /^# Server = /{
+ s|^# Server = \(.*//\)\([^/]*\)\(/.*\)\$arch/\$repo$|'"$(
+ printf \
+ ' %s\\n' \
+ '<li><a href="\1\2\3archisos/"' \
+ ' title="Download from \1\2\3">\2</a></li>'
+ )"'|
+ }
+ ' | \
+ sed '
+ 0,/<\/ul>/d
+ '
+ printf ' </ul>\n\n'
+ printf ' </div>\n'
+) | \
+ sed -i '
+ :emptyLines
+ /^\n*$/{
+ N
+ bemptyLines
+ }
+ /^\(\s*\n\)*\s*<div id="download-mirrors">$/{
+ :a
+ s|^.*</div>||
+ tb
+ $!N
+ ba
+ :b
+ r /dev/stdin
+ }
+ ' "${website_dir}/download/index.html"
+
+exit
+
latest_iso_date="$(
ls "${mirror_dir}/archisos" | \
grep '^archlinux-[0-9.]\+-\(dual\|i.86\)\.iso$' | \