aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch
blob: 4556293aa39c435ff51be2852a52dd495be68f74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 1db2db7783bd7ec2aa1da86e640019891634c659 Mon Sep 17 00:00:00 2001
From: Joakim Roubert <joakimr@axis.com>
Date: Fri, 16 Aug 2019 07:52:48 +0200
Subject: [PATCH] Use curl instead of wget

When curl's MIT license is preferable to wget's GPLv3.

Change-Id: I4684ae7569704514fdcc63e0655c556efcaf44f8
Signed-off-by: Joakim Roubert <joakimr@axis.com>
Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
---
 templates/lxc-download.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/templates/lxc-download.in b/templates/lxc-download.in
index e8570692a..f7291b0cc 100755
--- a/templates/lxc-download.in
+++ b/templates/lxc-download.in
@@ -75,9 +75,9 @@ cleanup() {
   fi
 }
 
-wget_wrapper() {
+curl_wrapper() {
   for _ in $(seq 3); do
-    if wget "$@"; then
+    if curl "$@"; then
       return 0
     fi
   done
@@ -86,8 +86,8 @@ wget_wrapper() {
 }
 
 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 ! wget_wrapper --user-agent="lxc/@PACKAGE_VERSION@ compat:${DOWNLOAD_COMPAT_LEVEL}" -T 30 -q "http://${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 --user-agent="lxc/@PACKAGE_VERSION@ compat:${DOWNLOAD_COMPAT_LEVEL}" -m 30 -s "http://${DOWNLOAD_SERVER}/$1" -o "$2" >/dev/null 2>&1; then
       if [ "$3" = "noexit" ]; then
         return 1
       else
@@ -277,7 +277,7 @@ while :; do
 done
 
 # Check for required binaries
-for bin in tar xz wget; do
+for bin in tar xz curl; do
   if ! command -V "${bin}" >/dev/null 2>&1; then
     echo "ERROR: Missing required tool: ${bin}" 1>&2
     exit 1
-- 
2.27.0