diff options
author | Elan Ruusamäe <glen@delfi.ee> | 2016-04-15 20:35:41 +0300 |
---|---|---|
committer | Elan Ruusamäe <glen@delfi.ee> | 2016-04-15 20:35:41 +0300 |
commit | 4832b78b52dd5fa0356475c2f09fb3184cd31156 (patch) | |
tree | 20c34ec1a7c828edff7803c79915299b660e1afa /web/Makefile.am | |
parent | 4728f89e2d0c42f9ad4da1e3075a0321553e9937 (diff) |
simplify obtaining commit hash. refs 51aa8e3
Diffstat (limited to 'web/Makefile.am')
-rw-r--r-- | web/Makefile.am | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/web/Makefile.am b/web/Makefile.am index a82dcf2f71..1b6b918be9 100644 --- a/web/Makefile.am +++ b/web/Makefile.am @@ -92,15 +92,9 @@ dist_webimages_DATA = \ version.txt: if test -d "$(top_srcdir)/.git"; then \ - if git --git-dir="$(top_srcdir)/.git" log -n 1 > v.tmp; then \ - grep ^commit v.tmp | cut -d" " -f2 > version.txt; \ - rm -f v.tmp; \ - else \ - rm -f v.tmp; \ - echo "0" > version.txt; \ - fi; \ - else \ - echo "0" > version.txt; \ - fi + git --git-dir="$(top_srcdir)/.git" log -n 1 --format=%H; \ + fi > $@.tmp + test -s $@.tmp || echo 0 > $@.tmp + mv $@.tmp $@ .PHONY: version.txt |