Merge pull request #9281 from heitbaum/wget12

scripts and tools: only use --passive-ftp for ftp: urls
This commit is contained in:
CvH 2024-10-17 20:16:10 +02:00 committed by GitHub
commit 0182d1ea4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -22,7 +22,7 @@ pkg_lock_status "GETPKG" "${PKG_NAME}" "unpack" "downloading package..."
PACKAGE_MIRROR="${DISTRO_MIRROR}/${PKG_NAME}/${PKG_SOURCE_NAME}"
[ "${VERBOSE}" != "yes" ] && WGET_OPT=-q
WGET_CMD="wget --output-file=- --timeout=30 --tries=3 --passive-ftp --no-check-certificate -c ${WGET_OPT} --progress=bar:force --show-progress -O ${PACKAGE}"
WGET_CMD="wget --output-file=- --timeout=30 --tries=3 --no-check-certificate -c ${WGET_OPT} --progress=bar:force --show-progress -O ${PACKAGE}"
# unset LD_LIBRARY_PATH to stop wget from using toolchain/lib and loading libssl.so/libcrypto.so instead of host libraries
unset LD_LIBRARY_PATH
@ -34,7 +34,8 @@ NBCHKS=2
while [ ${NBWGET} -gt 0 -a ${NBCHKS} -gt 0 ]; do
for url in "${PKG_URL}" "${PACKAGE_MIRROR}"; do
rm -f "${PACKAGE}"
if ${WGET_CMD} "${url}"; then
[[ "${url}" =~ ^[fF][tT][pP]:* ]] && WGET_FTP=--passive-ftp || WGET_FTP=
if ${WGET_CMD} ${WGET_FTP} "${url}"; then
CALC_SHA256=$(sha256sum "${PACKAGE}" | cut -d" " -f1)
[ -z "${PKG_SHA256}" -o "${PKG_SHA256}" = "${CALC_SHA256}" ] && break 2

View File

@ -357,7 +357,10 @@ class MyUtility(object):
while attempts < retries:
if stopped.is_set(): break
attempts += 1
(result, output) = MyUtility.runcommand(msgs, "wget --output-file=- --timeout=30 --tries=3 --passive-ftp --no-check-certificate -O %s %s" % (filename_data, url), logfile=filename_log)
if url.startswith("ftp:"):
(result, output) = MyUtility.runcommand(msgs, "wget --output-file=- --timeout=30 --tries=3 --no-check-certificate -O %s %s" % (filename_data, url), logfile=filename_log)
else
(result, output) = MyUtility.runcommand(msgs, "wget --output-file=- --timeout=30 --tries=3 --passive-ftp --no-check-certificate -O %s %s" % (filename_data, url), logfile=filename_log)
if result == 0:
return True