From: Xiangyu Chen <[email protected]>

Add support of redirect option for curl, the
linuxcontainers.org sometimes redirect to
other mirror site such like us.lxd.images.canonical.com,
this would cause the lxc-download script report
download failed.

Reproduce and verified on following command:
lxc-create -t download -n test -- --dist archlinux --release current --arch 
arm64

Signed-off-by: Xiangyu Chen <[email protected]>
---
 .../lxc/files/templates-use-curl-instead-of-wget.patch          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch 
b/recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch
index ff5c5f6..e9af833 100644
--- a/recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch
+++ b/recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch
@@ -35,7 +35,7 @@ index a62ddf482..690307338 100755
  
  download_file() {
 -  if ! wget_wrapper --user-agent="lxc/@PACKAGE_VERSION@ 
compat:${DOWNLOAD_COMPAT_LEVEL}" -T 30 -q "https://${DOWNLOAD_SERVER}/$1"; -O 
"$2" >/dev/null 2>&1; then
-+  if ! curl_wrapper --user-agent "lxc/@PACKAGE_VERSION@ 
compat:${DOWNLOAD_COMPAT_LEVEL}" -m 30 -s "https://${DOWNLOAD_SERVER}/$1"; -o 
"$2" >/dev/null 2>&1; then
++  if ! curl_wrapper -L --user-agent "lxc/@PACKAGE_VERSION@ 
compat:${DOWNLOAD_COMPAT_LEVEL}" -m 30 -s "https://${DOWNLOAD_SERVER}/$1"; -o 
"$2" >/dev/null 2>&1; then
      if [ "$3" = "noexit" ]; then
        return 1
      else
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7942): 
https://lists.yoctoproject.org/g/meta-virtualization/message/7942
Mute This Topic: https://lists.yoctoproject.org/mt/97669521/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to