From: Adam Sutton Date: Fri, 15 Jan 2016 22:56:16 +0000 (+0000) Subject: build: shallow clones don't properly report version number X-Git-Tag: v4.2.1~1162^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F788%2Fhead;p=thirdparty%2Ftvheadend.git build: shallow clones don't properly report version number This branches deb builder in such an environment (such as that used on travis-ci) --- diff --git a/support/version b/support/version index e65bf7e95..041d04fe6 100755 --- a/support/version +++ b/support/version @@ -12,7 +12,9 @@ if [ -d ".git" ]; then if [ $? -ne 0 ]; then # Git describe failed, maybe "--dirty" option is not available # Adding "-unknown" postfix to mark this situation - VER=$(cd "$(dirname "$0")/.."; git describe --match "v*" 2> /dev/null)-unknown + VER=$(cd "$(dirname "$0")/.."; git describe --match "v*" 2> /dev/null) + [ -z "$VER" ] && VER=0.0.0 + VER=${VER}-unknown fi VER=$(echo $VER | sed "s/^v//" | sed "s/-\([0-9]*\)-\(g[0-9a-f]*\)/-\1~\2/") elif [ -f "$(dirname "$0")/../debian/changelog" ]; then