tools: preserve make errors, ignore empty output
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 4 Jun 2017 21:54:51 +0000 (23:54 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 11 Jun 2017 00:49:19 +0000 (02:49 +0200)
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.

Makefile

index fb804a8ca2496116850511a62e65f6bc6e16d80d..85fc990f3abd1d59e0b49fa3893906f817c13e58 100644 (file)
--- 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; \