X-Git-Url: https://code.delx.au/pulseaudio/blobdiff_plain/ba2e5f4442b8f933f37411cc625598cc72938d33..ac984f59d36ef555bc5b0df9af1cd48193d0d14f:/git-version-gen diff --git a/git-version-gen b/git-version-gen index 1a3d13b9..724da666 100755 --- a/git-version-gen +++ b/git-version-gen @@ -1,6 +1,6 @@ #!/bin/sh # Print a version string. -scriptversion=2008-04-08.07.01 +scriptversion=2012-09-25.20 # Copyright (C) 2007-2008 Free Software Foundation # @@ -67,6 +67,7 @@ scriptversion=2008-04-08.07.01 # echo $(VERSION) > $@-t && mv $@-t $@ # dist-hook: # echo $(VERSION) > $(distdir)/.tarball-version +# echo $(VERSION) > $(distdir)/.version case $# in 1) ;; @@ -92,10 +93,19 @@ then && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 fi +# This is presently used by the GNOME-OSTree build system; it +# helps support the case where the meta-build system has already +# determined the git revision, but we may not be able to run "git describe" +# because we're inside a chroot. +if test -n "$GIT_DESCRIBE_FOR_BUILD"; +then + v=$GIT_DESCRIBE_FOR_BUILD +fi + if test -n "$v" then : # use $v -elif test -d .git \ +elif test -e .git \ && v=`git describe --abbrev=4 --match='v[0-9]*' HEAD 2>/dev/null` \ && [ -n "$v" ] then @@ -132,7 +142,8 @@ then # v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; : else - v=UNKNOWN + echo 1>&2 "$0: Failed to determine git revision" + exit 1 fi v=`echo "$v" |sed 's/^v//'`