diff options
author | Yann E. MORIN <yann.morin.1998@free.fr> | 2014-08-03 19:53:36 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2014-08-04 20:12:24 +0200 |
commit | 84469226c1d4e6b7bf7052ef9039b26991041311 (patch) | |
tree | 8f4a771c63b3d36620c9e6979e7a86355f9aa1ed /support | |
parent | c48d45e3424e8ad7a1f320a66a4bebc7c056e052 (diff) | |
download | buildroot-84469226c1d4e6b7bf7052ef9039b26991041311.tar.gz buildroot-84469226c1d4e6b7bf7052ef9039b26991041311.zip |
support/download: convert localfiles to use the wrapper
This drastically simplifies the localfiles helper, as it no longer has
to deal with atomically saving the downloaded archive.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
(Tested by setting BUSYBOX_SITE = file:///tmp and running 'make busybox-source')
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support')
-rwxr-xr-x | support/download/cp | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/support/download/cp b/support/download/cp index 8f6bc06f45..264f5dc522 100755 --- a/support/download/cp +++ b/support/download/cp @@ -1,26 +1,16 @@ #!/bin/bash -# We want to catch any command failure, and exit immediately +# We want to catch any unexpected failure, and exit immediately set -e -# Download helper for cp -# Call it with: -# $1: source file -# $2: output file +# Download helper for cp, to be called from the download wrapper script +# Expected arguments: +# $1: output file +# $2: source file # And this environment: # LOCALFILES: the cp command to call -source="${1}" -output="${2}" +output="${1}" +source="${2}" -tmp_output="$( mktemp "${output}.XXXXXX" )" - -ret=1 -if ${LOCALFILES} "${source}" "${tmp_output}"; then - mv "${tmp_output}" "${output}" - ret=0 -fi - -# Cleanup -rm -f "${tmp_output}" -exit ${ret} +${LOCALFILES} "${source}" "${output}" |