Skip to content
Snippets Groups Projects
Commit 05d6a095 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

Fix list of mirror

parent bba12e22
No related branches found
No related tags found
No related merge requests found
......@@ -168,15 +168,14 @@ choose_rankmirrors(){
done
echo 100 |dialog $DG_BACKTITLE $DG_OPTS --title "Rankmirrors" --no-kill --gauge "\nDownloading a fresh list of mirrors..." 0 0
rm -f "${error}"
list=$(grep "^## [A-Z]" /etc/pacman.d/mirrorlist.new | sed -e '1,2d' -e 's:^## ::' -e 's: :_:g')
list=$(grep "^## [A-Z]" /etc/pacman.d/mirrorlist.new | sed -e '1,2d' -e 's:^## ::' -e 's: :_:g'|sort -u)
dg_action country menu "Rankmirrors" "\nPlease select your country." ${list[@]}
if (( $? ));then
sed -i "s,RANKMIRRORS=.*$,RANKMIRRORS=\"no\",g" /etc/obarun/install.conf
return 0
fi
country=$(echo "${country}"|sed 's:_: :g')
awk '/^## '"${country}"'$/ {f=1} f==0 {next} /^$/ {exit} {print substr($0, 2)}' \
/etc/pacman.d/mirrorlist.new | grep -v '#' > /etc/pacman.d/mirrorlist.rank
sed -n "/## ${country}/,/##/{/^#Server/s/^#//p}" /etc/pacman.d/mirrorlist.new > /etc/pacman.d/mirrorlist.rank
touch "${rank}"
( \
rankmirrors -v -n 10 /etc/pacman.d/mirrorlist.rank > /etc/pacman.d/mirrorlist
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment