[Buildroot] [PATCH 1/1] package: fix WGET download method
Baruch Siach
baruch at tkos.co.il
Mon Mar 5 09:42:29 UTC 2012
Hi Thomas,
On Mon, Mar 05, 2012 at 10:31:05AM +0100, Thomas Petazzoni wrote:
[snip]
> +# Download a file using wget. Only download the file if it doesn't
> +# already exist in the download directory. If the download fails,
> +# remove the file (because wget -O creates a 0-byte file even if the
> +# download fails).
> define DOWNLOAD_WGET
> test -e $(DL_DIR)/$(2) || \
> - $(WGET) -O $(DL_DIR)/$(2) $(call qstrip,$(1))/$(2)
> + $(WGET) -O $(DL_DIR)/$(2) $(call qstrip,$(1))/$(2) || \
> + (rm $(DL_DIR)/$(2) ; exit 1)
'rm -f' may be better here, as wget might error out before creating any file,
thus causing a spurious "No such file or directory" message.
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
More information about the buildroot
mailing list