Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

More robust downloading #3

Merged
merged 3 commits into from
Jan 23, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/src_fetch.mgwpart
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ fetch() {
urifile=${uri%\?*};
urifile=${urifile##*/};

if check_prog wget
if check_prog curl
then
if wget --no-check-certificate -O ${urifile}.tmp ${uri}
if curl --retry 10 -L -k --url ${uri} -o ${urifile}.tmp
then
mv -f ${urifile}.tmp ${urifile}
else
rm -f ${urifile}.tmp
error "wget ${uri} failed"
error "curl ${uri} failed"
fi
elif check_prog curl
elif check_prog wget
then
if curl -k --url ${uri} -o ${urifile}.tmp
if wget --tries=10 --no-check-certificate -O ${urifile}.tmp ${uri}
then
mv -f ${urifile}.tmp ${urifile}
else
rm -f ${urifile}.tmp
error "curl ${uri} failed"
error "wget ${uri} failed"
fi
else
error "Either wget or curl are required to fetch sources.";
Expand Down