termux-tools: pkg: fix possible case where $current_mirror receives a multiline value

This commit is contained in:
Leonid Pliushch 2021-05-19 14:54:08 +03:00
parent 1e5ca4b743
commit c605627c40

View File

@ -79,7 +79,7 @@ select_mirror() {
mirrors[17]="https://termux.mentality.rip/termux-packages-24"
local current_mirror
current_mirror=$(grep -P "^\s*deb\s+" @TERMUX_PREFIX@/etc/apt/sources.list | grep -oP 'https?://[^\s]+')
current_mirror=$(grep -m 1 -P "^\s*deb\s+" @TERMUX_PREFIX@/etc/apt/sources.list | grep -oP 'https?://[^\s]+')
# Do not update mirror if:
# * If $TERMUX_PKG_NO_MIRROR_SELECT was set.