mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
create an option to allow ipv6 downloads (#3640)
* create an option to allow ipv6 downloads * Coding style fix Co-authored-by: Igor Pečovnik <igorpecovnik@users.noreply.github.com>
This commit is contained in:
@@ -607,6 +607,8 @@ if [[ -z ${ARMBIAN_MIRROR} ]]; then
|
||||
done
|
||||
fi
|
||||
|
||||
[[ -z $DISABLE_IPV6 ]] && DISABLE_IPV6="true"
|
||||
|
||||
# For (late) user override.
|
||||
# Notice: it is too late to define hook functions or add extensions in lib.config, since the extension initialization already ran by now.
|
||||
# in case the user tries to use them in lib.config, hopefully they'll be detected as "wishful hooking" and the user will be wrn'ed.
|
||||
|
||||
@@ -1625,6 +1625,8 @@ download_and_verify()
|
||||
local localdir=$SRC/cache/${remotedir//_}
|
||||
local dirname=${filename//.tar.xz}
|
||||
|
||||
[[ -z $DISABLE_IPV6 ]] && DISABLE_IPV6="true"
|
||||
|
||||
if [[ $DOWNLOAD_MIRROR == china ]]; then
|
||||
local server="https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/"
|
||||
elif [[ $DOWNLOAD_MIRROR == bfsu ]]; then
|
||||
@@ -1666,7 +1668,7 @@ download_and_verify()
|
||||
else
|
||||
# download control file
|
||||
local torrent=${server}$remotedir/${filename}.torrent
|
||||
aria2c --download-result=hide --disable-ipv6=true --summary-interval=0 --console-log-level=error --auto-file-renaming=false \
|
||||
aria2c --download-result=hide --disable-ipv6=$DISABLE_IPV6 --summary-interval=0 --console-log-level=error --auto-file-renaming=false \
|
||||
--continue=false --allow-overwrite=true --dir="${localdir}" ${server}${remotedir}/${filename}.asc $(webseed "$remotedir/${filename}.asc") -o "${filename}.asc"
|
||||
[[ $? -ne 0 ]] && display_alert "Failed to download control file" "" "wrn"
|
||||
fi
|
||||
@@ -1678,7 +1680,7 @@ download_and_verify()
|
||||
local ariatorrent="--summary-interval=0 --auto-save-interval=0 --seed-time=0 --bt-stop-timeout=120 --console-log-level=error \
|
||||
--allow-overwrite=true --download-result=hide --rpc-save-upload-metadata=false --auto-file-renaming=false \
|
||||
--file-allocation=trunc --continue=true ${torrent} \
|
||||
--dht-file-path=${SRC}/cache/.aria2/dht.dat --disable-ipv6=true --stderr --follow-torrent=mem --dir=$localdir"
|
||||
--dht-file-path=${SRC}/cache/.aria2/dht.dat --disable-ipv6=$DISABLE_IPV6 --stderr --follow-torrent=mem --dir=$localdir"
|
||||
|
||||
# exception. It throws error if dht.dat file does not exists. Error suppress needed only at first download.
|
||||
if [[ -f "${SRC}"/cache/.aria2/dht.dat ]]; then
|
||||
@@ -1699,7 +1701,7 @@ download_and_verify()
|
||||
if [[ ! `timeout 10 curl --head --fail --silent ${server}${remotedir}/${filename} 2>&1 >/dev/null` ]]; then
|
||||
display_alert "downloading using http(s) network" "$filename"
|
||||
aria2c --download-result=hide --rpc-save-upload-metadata=false --console-log-level=error \
|
||||
--dht-file-path="${SRC}"/cache/.aria2/dht.dat --disable-ipv6=true --summary-interval=0 --auto-file-renaming=false --dir="${localdir}" ${server}${remotedir}/${filename} $(webseed "${remotedir}/${filename}") -o "${filename}"
|
||||
--dht-file-path="${SRC}"/cache/.aria2/dht.dat --disable-ipv6=$DISABLE_IPV6 --summary-interval=0 --auto-file-renaming=false --dir="${localdir}" ${server}${remotedir}/${filename} $(webseed "${remotedir}/${filename}") -o "${filename}"
|
||||
# mark complete
|
||||
[[ $? -eq 0 ]] && touch "${localdir}/${filename}.complete" && echo ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user