[vlc-devel] [PATCH] contrib: remove empty file on download fail
Alexandre Janniaux
ajanni at videolabs.io
Wed Aug 26 11:22:59 CEST 2020
Hi,
This is probably missing `-f` in order to avoid failure with
the rm command, and the rm should probably be done before curl
so as to remove the dependency if it exists and correctly return
an error in case of failure with curl.
download = rm -f "$@" && curl -f -L -- "$(1)" > "$@"
Regards,
--
Alexandre Janniaux
Videolabs
On Wed, Aug 26, 2020 at 11:09:26AM +0200, Thomas Guillem wrote:
> This fixes package not downloaded again in case of a first failure.
>
> The other download rules (wget, fetch) are already following this behavior on
> fail.
> ---
> contrib/src/main.mak | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/src/main.mak b/contrib/src/main.mak
> index d0df860a954..fc1480cca19 100644
> --- a/contrib/src/main.mak
> +++ b/contrib/src/main.mak
> @@ -247,7 +247,7 @@ endif
> SVN ?= $(error subversion client (svn) not found)
>
> ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),)
> -download = curl -f -L -- "$(1)" > "$@"
> +download = curl -f -L -- "$(1)" > "$@" || rm "$@"
> else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),)
> download = (rm -f $@.tmp && \
> wget --passive -c -p -O $@.tmp "$(1)" && \
> --
> 2.28.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list