]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix version for launchpad builds using recipes
authorJohan Abbors <jabbors@gmail.com>
Tue, 2 Oct 2012 20:30:27 +0000 (23:30 +0300)
committerAdam Sutton <dev@adamsutton.me.uk>
Tue, 2 Oct 2012 23:44:22 +0000 (00:44 +0100)
Git operations are not allowed in launchpad, thus the version number
must be extracted from the changeleg.

support/version

index cfda9430ada5dad080e03c96a8f757dfa7800412..470de7c6f94c86dd7555f71bf90f248fab095ea5 100755 (executable)
@@ -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