summaryrefslogtreecommitdiff
path: root/src/url.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-03-11 08:34:42 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-03-11 08:40:25 +0000
commitca85bcb7bd3fccbf361e7e97c0dc3df12e4b5943 (patch)
treeaf647f451b4838ca928e43610035b35c9ad41353 /src/url.c
parent1c6ab67984b20b49ed12a0576e59cd446a44ae84 (diff)
downloadapk-tools-ca85bcb7bd3fccbf361e7e97c0dc3df12e4b5943.tar.gz
apk-tools-ca85bcb7bd3fccbf361e7e97c0dc3df12e4b5943.tar.bz2
apk-tools-ca85bcb7bd3fccbf361e7e97c0dc3df12e4b5943.tar.xz
apk-tools-ca85bcb7bd3fccbf361e7e97c0dc3df12e4b5943.zip
url: try wget from $PATH first and fallback to busybox wget
If GNU wget is available, then we want use it as it gives the user possibility to set misc options, such as bandwidth limit in wgetrc. It might also be that busybox is not available in case bootstrapping alpine from other distros (think debian vserver host creating an alpine guest) In any case we, fall back to busybox wget in case wget libs are getting upgraded. (see http://redmine.alpinelinux.org/issues/347)
Diffstat (limited to 'src/url.c')
-rw-r--r--src/url.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/url.c b/src/url.c
index d007860..0a17a7a 100644
--- a/src/url.c
+++ b/src/url.c
@@ -70,6 +70,10 @@ static int fork_wget(const char *url, pid_t *ppid)
close(fds[0]);
dup2(open("/dev/null", O_RDONLY), STDIN_FILENO);
dup2(fds[1], STDOUT_FILENO);
+ execlp("wget", "wget", "-q", "-O", "-", url, NULL);
+ /* fall back to busybox wget
+ * See http://redmine.alpinelinux.org/issues/347
+ */
execlp("busybox", "wget", "-q", "-O", "-", url, NULL);
exit(0);
}