From: Travis Cross Date: Fri, 22 Jun 2012 16:10:47 +0000 (+0000) Subject: Harmonize debian nightly version with print_git_revision X-Git-Tag: v1.2.0~276 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b16821944e92d6fb3da0b9a18f5922c6df18be5f;p=thirdparty%2Ffreeswitch.git Harmonize debian nightly version with print_git_revision Debian nightlies created with debian/util.sh now have the version set in the same format as Makefile.am produces. Unlike Makefile.am, however, we show the orig packaging date rather than the date of the latest commit, as the latter could legitimately regress and we need this to always increment. --- diff --git a/debian/util.sh b/debian/util.sh index 3f4fea312d..69a0ee6387 100755 --- a/debian/util.sh +++ b/debian/util.sh @@ -132,6 +132,17 @@ check_repo_clean () { || err "untracked files or build products present" } +get_last_release_ver () { + grep -m1 -e '^AC_INIT' configure.in \ + | cut -d, -f2 \ + | sed -e 's/\[//' -e 's/\]//' -e 's/ //g' +} + +get_nightly_version () { + local commit="$(git rev-list -n1 --abbrev=10 --abbrev-commit HEAD)" + echo "$(get_last_release_ver)+git~$(date +%Y%m%dT%H%M%SZ)~$commit" +} + create_orig () { { set -e @@ -147,7 +158,7 @@ create_orig () { done shift $(($OPTIND-1)) [ -z "$uver" ] || [ "$uver" = "nightly" ] \ - && uver="$(cat build/next-release.txt)-n$(date +%Y%m%dT%H%M%SZ)" + && uver="$(get_nightly_version)" local treeish="$1" dver="$(mk_dver "$uver")" local orig="../freeswitch_$dver.orig.tar.xz" [ -n "$treeish" ] || treeish="HEAD"