support/download: add download wrapper
authorYann E. MORIN <yann.morin.1998@free.fr>
Sun, 3 Aug 2014 17:53:34 +0000 (19:53 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 4 Aug 2014 18:12:24 +0000 (20:12 +0200)
commitb5a9470bdfeccb50170d279aedc541a2c665770c
treee186305a4d68ea9e16754dd3ab098bebaa14185e
parent79c77a6e7fdf162e5609d46b00c99a7d177a381b
support/download: add download wrapper

The download wrapper is responsible for ensuring the atomicity
of saving into $(BR2_DL_DIR).

It calls the appropriate download helper, telling it to save the
downloaded content to a temporary file in $(BUILD_DIR) (so it does
not clutter $(BR2_DL_DIR) with partial, failed downloads.

Then, only if the download helper was successful, does the wrapper
save the downloaded content to the final location, yet still in a
temporary file, and finally atomically renames it to the final output
file.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/download/wrapper [new file with mode: 0755]