summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flag-names60
-rwxr-xr-xupdate-website58
2 files changed, 118 insertions, 0 deletions
diff --git a/flag-names b/flag-names
new file mode 100644
index 0000000..82d7dd0
--- /dev/null
+++ b/flag-names
@@ -0,0 +1,60 @@
+au Australia
+at Austria
+by Belarus
+be Belgium
+ba Bosnia and Herzegovina
+br Brazil
+bg Bulgaria
+ca Canada
+cl Chile
+cn China
+co Colombia
+hr Croatia
+cz Czech Republic
+dk Denmark
+ec Ecuador
+fi Finland
+fr France
+de Germany
+gr Greece
+hk Hong Kong
+hu Hungary
+is Iceland
+in India
+id Indonesia
+ir Iran
+ie Ireland
+il Israel
+it Italy
+jp Japan
+kz Kazakhstan
+lv Latvia
+lt Lithuania
+lu Luxembourg
+mk Macedonia
+nl Netherlands
+nc New Caledonia
+nz New Zealand
+no Norway
+ph Philippines
+pl Poland
+pt Portugal
+qa Qatar
+ro Romania
+ru Russia
+rs Serbia
+sg Singapore
+sk Slovakia
+si Slovenia
+za South Africa
+kr South Korea
+es Spain
+se Sweden
+ch Switzerland
+tw Taiwan
+th Thailand
+tr Turkey
+ua Ukraine
+gb United Kingdom
+us United States
+vn Vietnam
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$' | \