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 | |
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>
-rw-r--r-- | recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch | 49 | ||||
-rw-r--r-- | recipes-containers/lxc/lxc_3.2.1.bb | 3 |
2 files changed, 51 insertions, 1 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 | ||
diff --git a/recipes-containers/lxc/lxc_3.2.1.bb b/recipes-containers/lxc/lxc_3.2.1.bb index 4b8f10b0..b8525156 100644 --- a/recipes-containers/lxc/lxc_3.2.1.bb +++ b/recipes-containers/lxc/lxc_3.2.1.bb | |||
@@ -5,10 +5,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" | |||
5 | DEPENDS = "libxml2 libcap" | 5 | DEPENDS = "libxml2 libcap" |
6 | RDEPENDS_${PN} = " \ | 6 | RDEPENDS_${PN} = " \ |
7 | rsync \ | 7 | rsync \ |
8 | curl \ | ||
8 | gzip \ | 9 | gzip \ |
9 | xz \ | 10 | xz \ |
10 | tar \ | 11 | tar \ |
11 | wget \ | ||
12 | libcap-bin \ | 12 | libcap-bin \ |
13 | bridge-utils \ | 13 | bridge-utils \ |
14 | dnsmasq \ | 14 | dnsmasq \ |
@@ -41,6 +41,7 @@ SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \ | |||
41 | file://logs-optionally-use-base-filenames-to-report-src-fil.patch \ | 41 | file://logs-optionally-use-base-filenames-to-report-src-fil.patch \ |
42 | file://templates-actually-create-DOWNLOAD_TEMP-directory.patch \ | 42 | file://templates-actually-create-DOWNLOAD_TEMP-directory.patch \ |
43 | file://template-make-busybox-template-compatible-with-core-.patch \ | 43 | file://template-make-busybox-template-compatible-with-core-.patch \ |
44 | file://templates-use-curl-instead-of-wget.patch \ | ||
44 | file://tests-our-init-is-not-busybox.patch \ | 45 | file://tests-our-init-is-not-busybox.patch \ |
45 | file://tests-add-no-validate-when-using-download-template.patch \ | 46 | file://tests-add-no-validate-when-using-download-template.patch \ |
46 | file://network-restore-ability-to-move-nl80211-devices.patch \ | 47 | file://network-restore-ability-to-move-nl80211-devices.patch \ |