mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
Merge pull request #9347 from antonlacon/use-curl
buildsystem: replace wget with curl
This commit is contained in:
commit
00b8c80375
@ -58,6 +58,7 @@ dep_map=(
|
|||||||
[bash]=bash
|
[bash]=bash
|
||||||
[bc]=bc
|
[bc]=bc
|
||||||
[bzip2]=bzip2
|
[bzip2]=bzip2
|
||||||
|
[curl]=curl
|
||||||
[diff]=diffutils
|
[diff]=diffutils
|
||||||
[gawk]=gawk
|
[gawk]=gawk
|
||||||
[gcc]=gcc
|
[gcc]=gcc
|
||||||
@ -74,7 +75,6 @@ dep_map=(
|
|||||||
[sed]=sed
|
[sed]=sed
|
||||||
[tar]=tar
|
[tar]=tar
|
||||||
[unzip]=unzip
|
[unzip]=unzip
|
||||||
[wget]=wget
|
|
||||||
[xz]=xz-utils
|
[xz]=xz-utils
|
||||||
[zip]=zip
|
[zip]=zip
|
||||||
[zstd]=zstd
|
[zstd]=zstd
|
||||||
|
@ -21,21 +21,21 @@ build_msg "CLR_GET" "GET" "${1} (archive)" "indent"
|
|||||||
pkg_lock_status "GETPKG" "${PKG_NAME}" "unpack" "downloading package..."
|
pkg_lock_status "GETPKG" "${PKG_NAME}" "unpack" "downloading package..."
|
||||||
|
|
||||||
PACKAGE_MIRROR="${DISTRO_MIRROR}/${PKG_NAME}/${PKG_SOURCE_NAME}"
|
PACKAGE_MIRROR="${DISTRO_MIRROR}/${PKG_NAME}/${PKG_SOURCE_NAME}"
|
||||||
[ "${VERBOSE}" != "yes" ] && WGET_OPT=-q
|
|
||||||
WGET_CMD="wget --output-file=- --timeout=30 --tries=3 --no-check-certificate -c ${WGET_OPT} --progress=bar:force --show-progress -O ${PACKAGE}"
|
[ "${VERBOSE}" != "yes" ] && GET_OPT="--silent --show-error"
|
||||||
|
GET_CMD="curl ${GET_OPT} --connect-timeout 30 --retry 3 --continue-at - --location --max-redirs 5 --output ${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 to stop wget from using toolchain/lib and loading libssl.so/libcrypto.so instead of host libraries
|
||||||
unset LD_LIBRARY_PATH
|
unset LD_LIBRARY_PATH
|
||||||
|
|
||||||
rm -f "${STAMP_URL}" "${STAMP_SHA}"
|
rm -f "${STAMP_URL}" "${STAMP_SHA}"
|
||||||
|
|
||||||
NBWGET=10
|
NBGET=10
|
||||||
NBCHKS=2
|
NBCHKS=2
|
||||||
while [ ${NBWGET} -gt 0 -a ${NBCHKS} -gt 0 ]; do
|
while [ ${NBGET} -gt 0 -a ${NBCHKS} -gt 0 ]; do
|
||||||
for url in "${PKG_URL}" "${PACKAGE_MIRROR}"; do
|
for url in "${PKG_URL}" "${PACKAGE_MIRROR}"; do
|
||||||
rm -f "${PACKAGE}"
|
rm -f "${PACKAGE}"
|
||||||
[[ "${url}" =~ ^[fF][tT][pP]:* ]] && WGET_FTP=--passive-ftp || WGET_FTP=
|
if ${GET_CMD} "${url}"; then
|
||||||
if ${WGET_CMD} ${WGET_FTP} "${url}"; then
|
|
||||||
CALC_SHA256=$(sha256sum "${PACKAGE}" | cut -d" " -f1)
|
CALC_SHA256=$(sha256sum "${PACKAGE}" | cut -d" " -f1)
|
||||||
|
|
||||||
[ -z "${PKG_SHA256}" -o "${PKG_SHA256}" = "${CALC_SHA256}" ] && break 2
|
[ -z "${PKG_SHA256}" -o "${PKG_SHA256}" = "${CALC_SHA256}" ] && break 2
|
||||||
@ -49,10 +49,10 @@ while [ ${NBWGET} -gt 0 -a ${NBCHKS} -gt 0 ]; do
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
NBWGET=$((NBWGET - 1))
|
NBGET=$((NBGET - 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ ${NBWGET} -eq 0 -o ${NBCHKS} -eq 0 ]; then
|
if [ ${NBGET} -eq 0 -o ${NBCHKS} -eq 0 ]; then
|
||||||
die "\nCannot get ${1} sources : ${PKG_URL}\nTry later!"
|
die "\nCannot get ${1} sources : ${PKG_URL}\nTry later!"
|
||||||
else
|
else
|
||||||
build_msg "CLR_INFO" "INFO" "Calculated checksum: ${CALC_SHA256}"
|
build_msg "CLR_INFO" "INFO" "Calculated checksum: ${CALC_SHA256}"
|
||||||
|
@ -348,7 +348,7 @@ class MyUtility(object):
|
|||||||
raise
|
raise
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
# Use wget with same parameters as scripts/get is using
|
# Use same get command as scripts/get_archive is using
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def download_file(msgs, filename_data, filename_log, url):
|
def download_file(msgs, filename_data, filename_log, url):
|
||||||
retries=10
|
retries=10
|
||||||
@ -357,10 +357,7 @@ class MyUtility(object):
|
|||||||
while attempts < retries:
|
while attempts < retries:
|
||||||
if stopped.is_set(): break
|
if stopped.is_set(): break
|
||||||
attempts += 1
|
attempts += 1
|
||||||
if url.startswith("ftp:"):
|
(result, output) = MyUtility.runcommand(msgs, f"curl --silent --show-error --connect-timeout 30 --retry 3 --continue-at - --location --max-redirs 5 --output {filename_data} {url}", logfile=filename_log)
|
||||||
(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:
|
if result == 0:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ RUN echo "deb http://deb.debian.org/debian bookworm-backports main" > /etc/apt/s
|
|||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
|
|
||||||
RUN apt-get install -y \
|
RUN apt-get install -y \
|
||||||
wget bash bc gcc sed patch patchutils tar bzip2 gzip xz-utils zstd perl gawk gperf zip \
|
curl bash bc gcc sed patch patchutils tar bzip2 gzip xz-utils zstd perl gawk gperf zip \
|
||||||
unzip diffutils lzop make file g++ xfonts-utils xsltproc default-jre-headless python3 \
|
unzip diffutils lzop make file g++ xfonts-utils xsltproc default-jre-headless python3 \
|
||||||
libc6-dev libncurses5-dev libjson-perl libxml-parser-perl libparse-yapp-perl rdfind \
|
libc6-dev libncurses5-dev libjson-perl libxml-parser-perl libparse-yapp-perl rdfind \
|
||||||
golang-1.21-go/bookworm-backports git openssh-client rsync \
|
golang-1.21-go/bookworm-backports git openssh-client rsync \
|
||||||
|
@ -18,7 +18,7 @@ RUN adduser --disabled-password --gecos '' docker \
|
|||||||
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
wget bash bc gcc-10 sed patch patchutils tar bzip2 gzip xz-utils zstd perl gawk gperf zip \
|
curl bash bc gcc-10 sed patch patchutils tar bzip2 gzip xz-utils zstd perl gawk gperf zip \
|
||||||
unzip diffutils lzop make file g++-10 xfonts-utils xsltproc default-jre-headless python3 \
|
unzip diffutils lzop make file g++-10 xfonts-utils xsltproc default-jre-headless python3 \
|
||||||
libc6-dev libncurses5-dev libjson-perl libxml-parser-perl libparse-yapp-perl \
|
libc6-dev libncurses5-dev libjson-perl libxml-parser-perl libparse-yapp-perl \
|
||||||
golang-1.18-go git openssh-client rsync \
|
golang-1.18-go git openssh-client rsync \
|
||||||
|
@ -19,7 +19,7 @@ RUN adduser --disabled-password --gecos '' docker \
|
|||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
|
|
||||||
RUN apt-get install -y \
|
RUN apt-get install -y \
|
||||||
wget bash bc gcc-12 sed patch patchutils tar bzip2 gzip xz-utils zstd perl gawk gperf zip \
|
curl bash bc gcc-12 sed patch patchutils tar bzip2 gzip xz-utils zstd perl gawk gperf zip \
|
||||||
unzip diffutils lzop make file g++-12 xfonts-utils xsltproc default-jre-headless python3 \
|
unzip diffutils lzop make file g++-12 xfonts-utils xsltproc default-jre-headless python3 \
|
||||||
libc6-dev libncurses5-dev libjson-perl libxml-parser-perl libparse-yapp-perl rdfind \
|
libc6-dev libncurses5-dev libjson-perl libxml-parser-perl libparse-yapp-perl rdfind \
|
||||||
golang-1.21-go git openssh-client rsync \
|
golang-1.21-go git openssh-client rsync \
|
||||||
|
@ -18,7 +18,7 @@ RUN useradd docker -U -G sudo -m -s /bin/bash \
|
|||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
|
|
||||||
RUN apt-get install -y \
|
RUN apt-get install -y \
|
||||||
wget bash bc gcc-14 cpp-14 sed patch patchutils tar bzip2 gzip xz-utils zstd perl gawk gperf zip \
|
curl bash bc gcc-14 cpp-14 sed patch patchutils tar bzip2 gzip xz-utils zstd perl gawk gperf zip \
|
||||||
unzip diffutils lzop make file g++-14 xfonts-utils xsltproc default-jre-headless python3 \
|
unzip diffutils lzop make file g++-14 xfonts-utils xsltproc default-jre-headless python3 \
|
||||||
libc6-dev libncurses5-dev libjson-perl libxml-parser-perl libparse-yapp-perl rdfind \
|
libc6-dev libncurses5-dev libjson-perl libxml-parser-perl libparse-yapp-perl rdfind \
|
||||||
golang-go git openssh-client rsync \
|
golang-go git openssh-client rsync \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user