always try to download latest mirrorlist file from server

This commit is contained in:
Tobias Powalowski 2013-07-14 12:08:28 +02:00
parent 837d875b25
commit 5f125d9990

View file

@ -2847,6 +2847,14 @@ getsource() {
# args: none # args: none
# returns: nothing # returns: nothing
select_mirror() { select_mirror() {
## Download updated mirrorlist, if possible
curl 'https://www.archlinux.org/mirrorlist/?country=all&protocol=http&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on' > /tmp/pacman_mirrorlist.txt
if [[ "$(grep '#Server = http:' /tmp/pacman_mirrorlist.txt)" ]]; then
mv "${MIRRORLIST}" "${MIRRORLIST}.bak"
cp /tmp/pacman_mirrorlist.txt "${MIRRORLIST}"
fi
# FIXME: this regex doesn't honor commenting # FIXME: this regex doesn't honor commenting
MIRRORS=$(egrep -o '((http)|(https))://[^/]*' "${MIRRORLIST}" | sed 's|$| _|g') MIRRORS=$(egrep -o '((http)|(https))://[^/]*' "${MIRRORLIST}" | sed 's|$| _|g')
DIALOG --menu "Select a mirror" 14 55 7 \ DIALOG --menu "Select a mirror" 14 55 7 \