diff options
author | Joakim Roubert <joakim.roubert@axis.com> | 2019-09-17 15:47:27 +0200 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-09-18 13:53:26 -0400 |
commit | 468a24df91232d292a3ff907085ad17c604a36c1 (patch) | |
tree | 28ca7ab44277367f037ac207e591f6619e161ca7 /recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch | |
parent | c310d745c7506b55a711293d64960fb176fa5fca (diff) | |
download | meta-virtualization-468a24df91232d292a3ff907085ad17c604a36c1.tar.gz |
templates/lxc-download.in: Use curl instead of wget
When curl's MIT license is preferable to wget's GPLv3. Which it is in
several situations.
Change-Id: I72ee1ce66493c564557b73fae80f5219ef83af6d
Signed-off-by: Joakim Roubert <joakimr@axis.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch')
-rw-r--r-- | recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch | 49 |
1 files changed, 49 insertions, 0 deletions
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 new file mode 100644 index 00000000..4b185bf0 --- /dev/null +++ b/recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From dd7b0a2e4542c352456747a45d7eeb11e9fdec26 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joakim Roubert <joakimr@axis.com> | ||
3 | Date: Fri, 16 Aug 2019 07:52:48 +0200 | ||
4 | Subject: [PATCH] Use curl instead of wget | ||
5 | |||
6 | When curl's MIT license is preferable to wget's GPLv3. | ||
7 | |||
8 | Change-Id: I4684ae7569704514fdcc63e0655c556efcaf44f8 | ||
9 | Signed-off-by: Joakim Roubert <joakimr@axis.com> | ||
10 | --- | ||
11 | templates/lxc-download.in | 10 +++++----- | ||
12 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
13 | |||
14 | diff --git a/templates/lxc-download.in b/templates/lxc-download.in | ||
15 | index b70daaf..9526eae 100644 | ||
16 | --- a/templates/lxc-download.in | ||
17 | +++ b/templates/lxc-download.in | ||
18 | @@ -74,9 +74,9 @@ cleanup() { | ||
19 | fi | ||
20 | } | ||
21 | |||
22 | -wget_wrapper() { | ||
23 | +curl_wrapper() { | ||
24 | for _ in $(seq 3); do | ||
25 | - if wget "$@"; then | ||
26 | + if curl "$@"; then | ||
27 | return 0 | ||
28 | fi | ||
29 | done | ||
30 | @@ -85,8 +85,8 @@ wget_wrapper() { | ||
31 | } | ||
32 | |||
33 | download_file() { | ||
34 | - if ! wget_wrapper -T 30 -q "https://${DOWNLOAD_SERVER}/$1" -O "$2" >/dev/null 2>&1; then | ||
35 | - if ! wget_wrapper -T 30 -q "http://${DOWNLOAD_SERVER}/$1" -O "$2" >/dev/null 2>&1; then | ||
36 | + if ! curl_wrapper -m 30 -s "https://${DOWNLOAD_SERVER}/$1" -o "$2" >/dev/null 2>&1; then | ||
37 | + if ! curl_wrapper -m 30 -s "http://${DOWNLOAD_SERVER}/$1" -o "$2" >/dev/null 2>&1; then | ||
38 | if [ "$3" = "noexit" ]; then | ||
39 | return 1 | ||
40 | else | ||
41 | @@ -266,7 +266,7 @@ while :; do | ||
42 | done | ||
43 | |||
44 | # Check for required binaries | ||
45 | -for bin in tar xz wget; do | ||
46 | +for bin in tar xz curl; do | ||
47 | if ! command -V "${bin}" >/dev/null 2>&1; then | ||
48 | echo "ERROR: Missing required tool: ${bin}" 1>&2 | ||
49 | exit 1 | ||