diff options
author | Yann E. MORIN <yann.morin.1998@free.fr> | 2014-07-02 23:11:23 +0200 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2014-07-03 00:00:15 +0200 |
commit | 4bee7629eeb524b774357f57fbe53f136ae812c0 (patch) | |
tree | fba3b3a43230831bbfe4de5eb4cb889a8fad2185 /support | |
parent | 2fd4b959bd8b8e9d8657de9f458215ecd3b9d072 (diff) |
pkg-infra: move the wget download helper to a script
Maintaining the download helpers in the Makefile has proved to be a bit
complex, so move it to a shell script.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'support')
-rwxr-xr-x | support/download/wget | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/support/download/wget b/support/download/wget new file mode 100755 index 000000000..91ffd1004 --- /dev/null +++ b/support/download/wget @@ -0,0 +1,21 @@ +#!/bin/bash + +# We want to catch any command failure, and exit immediately +set -e + +# Download helper for wget +# Call it with: +# $1: URL +# $2: output file +# And this environment: +# WGET : the wget command to call + +url="${1}" +output="${2}" + +if ${WGET} -O "${output}.tmp" "${url}"; then + mv "${output}.tmp" "${output}" +else + rm -f "${output}.tmp" + exit 1 +fi |