From: Mischa POSLAWSKY Date: Sun, 4 Jun 2017 21:54:51 +0000 (+0200) Subject: tools: preserve make errors, ignore empty output X-Git-Tag: v1.11~60 X-Git-Url: http://git.shiar.net/sheet.git/commitdiff_plain/94fea8c0e6ba8cea67d69dd0e49142811bba1611 tools: preserve make errors, ignore empty output Exit codes lost since commit v1.9-305-ga7e3d17ab8 (2017-05-29) [tools: atomic creation of include files]. Fixed using `mispipe` also provided by moreutils. As additional fail-safe, also catch empty results with `ifne` to keep existing data on failure. --- diff --git a/Makefile b/Makefile index fb804a8..85fc990 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ download: data/DerivedAge.txt data/rfc1345.txt data/xorg-compose data/countryInf .PHONY: download # atomically create file by command -cmdsave = @echo $1 $2 \>$@; $1 $2 | sponge $@ +cmdsave = @echo $1 $2 \>$@; mispipe '$1 $2' 'ifne sponge $@' # download git checkout gitsave = @if cd $@ 2>/dev/null; \ then echo git pull $@; git pull -q --ff-only || true; \