[ccache] PATCH: Fix version.c for older gits

2010-09-24 Thread Wilson Snyder

git describe --dirty is a very recent addition.  I would
suggest the following so that the version works properly on
older versions.

Thanks!

diff --git a/dev.mk.in b/dev.mk.in
index d4dc1f7..1a7c00b 100644
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -8,7 +8,7 @@ XSLTPROC = xsltproc
 MANPAGE_XSL = /etc/asciidoc/docbook-xsl/manpage.xsl
 
 version := \
-$(shell (git describe --dirty 2/dev/null || echo vunknown) \
+$(shell (git describe --dirty 2/dev/null || git describe 2/dev/null || 
echo vunknown) \
 | sed -e 's/v//' -e 's/-/+/' -e 's/-/_/g')
 
 dist_dir = ccache-$(version)

___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] PATCH: Fix version.c for older gits

2010-09-24 Thread Mike Frysinger
On Fri, Sep 24, 2010 at 14:46, Wilson Snyder wrote:
 -    $(shell (git describe --dirty 2/dev/null || echo vunknown) \
 +    $(shell (git describe --dirty 2/dev/null || git describe 2/dev/null || 
 echo vunknown) \

probably better to move the stderr outside of the subshell:
   $(shell (git describe --dirty || git describe || echo vunknown)
2/dev/null \
-mike
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache