From: Johan Abbors Date: Tue, 2 Oct 2012 20:30:27 +0000 (+0300) Subject: Fix version for launchpad builds using recipes X-Git-Tag: v3.5~408 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a7e2b489f56f59e47a7dfd41027084ded5dcbc4;p=thirdparty%2Ftvheadend.git Fix version for launchpad builds using recipes Git operations are not allowed in launchpad, thus the version number must be extracted from the changeleg. --- diff --git a/support/version b/support/version index cfda9430a..470de7c6f 100755 --- a/support/version +++ b/support/version @@ -7,7 +7,11 @@ FILE=$1 # Calculate version -VER=$(cd $(dirname $0); git describe --dirty 2> /dev/null | sed "s/-\([0-9]*\)-\(g[0-9a-f]*\)/.\1~\2/") +if [ -d ".git" ]; then + VER=$(cd $(dirname $0); git describe --dirty 2> /dev/null | sed "s/-\([0-9]*\)-\(g[0-9a-f]*\)/.\1~\2/") +else + VER=$(head -1 $(dirname $0)/../debian/changelog | awk '{ print $2 }' | tr -d '()' | cut -d '-' -f 1) +fi # Output if [ -z "$FILE" ]; then