simplify obtaining commit hash. refs 51aa8e3
Elan Ruusamäe committed
Apr 15, 2016 at 20:35 UTC
4832b78b52dd5fa0356475c2f09fb3184cd31156
1 file changed
+4
-10
web/Makefile.am
+4
-10
@@ -92,15 +92,9 @@ dist_webimages_DATA = \
92
93
version.txt:
94
if test -d "$(top_srcdir)/.git"; then \
95
- if git --git-dir="$(top_srcdir)/.git" log -n 1 > v.tmp; then \
96
- grep ^commit v.tmp | cut -d" " -f2 > version.txt; \
97
- rm -f v.tmp; \
98
- else \
99
- rm -f v.tmp; \
100
- echo "0" > version.txt; \
101
- fi; \
102
- else \
103
- echo "0" > version.txt; \
104
- fi
95
+ git --git-dir="$(top_srcdir)/.git" log -n 1 --format=%H; \
96
+ fi > $@.tmp
97
+ test -s $@.tmp || echo 0 > $@.tmp
98
+ mv $@.tmp $@
99
100
.PHONY: version.txt