termux-tools: pkg: add more mirrors to rotation list

To decrease load on individual mirrors.
This commit is contained in:
Henrik Grimler 2022-03-01 13:30:26 +01:00
parent bece2c3ce4
commit 43f510f29b
No known key found for this signature in database
GPG Key ID: B0076E490B71616B
2 changed files with 13 additions and 7 deletions

View File

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://termux.org/
TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.165
TERMUX_PKG_VERSION=0.166
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
TERMUX_PKG_ESSENTIAL=true

View File

@ -72,11 +72,14 @@ select_mirror() {
local main_repo="https://packages-cf.termux.org/apt/termux-main"
declare -A mirrors
mirrors[35]="$main_repo"
mirrors[18]="https://dl.kcubeterm.com/termux-main"
mirrors[17]="https://grimler.se/termux-packages-24"
mirrors[16]="https://termux.mentality.rip/termux-main"
mirrors[14]="https://termux.librehat.com/apt/termux-main"
mirrors[16]="$main_repo"
mirrors[15]="https://dl.kcubeterm.com/termux-main"
mirrors[14]="https://grimler.se/termux-packages-24"
mirrors[13]="https://termux.mentality.rip/termux-main"
mirrors[12]="https://termux.astra.in.ua/apt/termux-main"
mirrors[11]="https://termux.librehat.com/apt/termux-main"
mirrors[10]="https://mirror.mwt.me/termux/main"
mirrors[ 9]="https://termux.sahilister.in/apt/termux-main"
local current_mirror
current_mirror=$(grep -m 1 -P "^\s*deb\s+" @TERMUX_PREFIX@/etc/apt/sources.list | grep -oP 'https?://[^\s]+')
@ -84,7 +87,10 @@ select_mirror() {
# Do not update mirror if:
# * If $TERMUX_PKG_NO_MIRROR_SELECT was set.
# * Uses .cn domain - specific to Chinese users.
if [ -n "${TERMUX_PKG_NO_MIRROR_SELECT-}" ] || [[ "$(hostname "$current_mirror")" == *".cn" ]]; then
# * Uses mirror.bardia.tech, mirror based in Iran.
if [ -n "${TERMUX_PKG_NO_MIRROR_SELECT-}" ] || \
[[ "$(hostname "$current_mirror")" == *".cn" ]] || \
[[ "$(hostname "$current_mirror")" == *"mirror.bardia.tech"* ]]; then
return
fi