[vlc-devel] [PATCH] contrib: remove empty file on download fail

Rémi Denis-Courmont remi at remlab.net
Wed Aug 26 15:41:04 CEST 2020


Le keskiviikkona 26. elokuuta 2020, 12.09.26 EEST Thomas Guillem a écrit :
> 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)" && \

That works if curl fails, but not if make dies. And even if your make is bug-
free, hardware problems can always occur.

-- 
Rémi Denis-Courmont
http://www.remlab.net/





More information about the vlc-devel mailing list