From b16821944e92d6fb3da0b9a18f5922c6df18be5f Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Fri, 22 Jun 2012 16:10:47 +0000 Subject: [PATCH] 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. --- debian/util.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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"