tools: output git action during make
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 4 Jun 2017 21:53:35 +0000 (23:53 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 11 Jun 2017 00:49:19 +0000 (02:49 +0200)
Either clone or pull with matching echo, quiet execution.

Makefile

index 8ff1638367ccc9d73f8362f3f791649309c08a90..fb804a8ca2496116850511a62e65f6bc6e16d80d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,9 +7,9 @@ download: data/DerivedAge.txt data/rfc1345.txt data/xorg-compose data/countryInf
 # atomically create file by command
 cmdsave = @echo $1 $2 \>$@; $1 $2 | sponge $@
 # download git checkout
-gitsave = @echo git pull or clone $@; \
-       [ -r $@/.git ] && cd $@ && git pull --ff-only || true; \
-       [ -e $@ ] || git clone "$1" $@
+gitsave = @if cd $@ 2>/dev/null; \
+       then echo git pull $@; git pull -q --ff-only || true; \
+       else echo git clone $1 $@; git clone -q --progress $1 $@; fi
 
 sitemap.xml: tools/mksitemap
        $(call cmdsave,$<)