[Spice-devel] [PATCH spice-gtk] build: Generate correct version when spice-gtk is a submodule

Christophe de Dinechin christophe at dinechin.org
Wed Apr 18 14:22:23 UTC 2018


From: Christophe de Dinechin <dinechin at redhat.com>

When spice-gtk is a submodule, .git is not a directory but a file.
Testing for a file avoids an "UNKNOWN" version

Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
---
 build-aux/git-version-gen | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 5617eb8..f8e8b23 100755
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2010-06-14.19; # UTC
+scriptversion=2018-04-17.14; # UTC
 
 # Copyright (C) 2007-2010 Free Software Foundation, Inc.
 #
@@ -98,7 +98,7 @@ fi
 if test -n "$v"
 then
     : # use $v
-elif test -d .git \
+elif test -d .git -o -f .git \
     && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
 	  || git describe --abbrev=4 HEAD 2>/dev/null` \
     && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
-- 
2.13.5 (Apple Git-94)



More information about the Spice-devel mailing list