From 53c24a93e08ab9db9b7514c6a0bb17cc4e8e32d5 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Fri, 21 Sep 2012 18:27:13 +0000 Subject: [PATCH] debian: Add support for humanized version string --- build/set-fs-version.sh | 3 ++- debian/util.sh | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/build/set-fs-version.sh b/build/set-fs-version.sh index 6743b58b5f..acac71db60 100755 --- a/build/set-fs-version.sh +++ b/build/set-fs-version.sh @@ -8,9 +8,10 @@ sdir="." check_pwd check_input_ver_build $@ in_ver="$1" +in_hrev="$2" if [ "$in_ver" = "auto" ]; then in_ver="$(cat build/next-release.txt)" fi eval $(parse_version "$in_ver") -set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev" +set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev" "$in_hrev" diff --git a/debian/util.sh b/debian/util.sh index 717a78364e..43278c2920 100755 --- a/debian/util.sh +++ b/debian/util.sh @@ -143,11 +143,15 @@ get_nightly_version () { echo "$(get_last_release_ver)+git~$(date -u '+%Y%m%dT%H%M%SZ')~$commit" } +get_nightly_revision_human () { + echo "git $(git rev-list -n1 --abbrev=7 --abbrev-commit HEAD) $(date -u '+%Y-%m-%d %H:%M:%SZ')" +} + create_orig () { { set -e local OPTIND OPTARG - local uver="" bundle_deps=false zl=9e + local uver="" hrev="" bundle_deps=false zl=9e while getopts 'bnv:z:' o "$@"; do case "$o" in b) bundle_deps=true;; @@ -157,8 +161,10 @@ create_orig () { esac done shift $(($OPTIND-1)) - [ -z "$uver" ] || [ "$uver" = "nightly" ] \ - && uver="$(get_nightly_version)" + if [ -z "$uver" ] || [ "$uver" = "nightly" ]; then + uver="$(get_nightly_version)" + hrev="$(get_nightly_revision_human)" + fi local treeish="$1" dver="$(mk_dver "$uver")" local orig="../freeswitch_$dver.orig.tar.xz" [ -n "$treeish" ] || treeish="HEAD" @@ -175,7 +181,7 @@ create_orig () { (cd libs && getlibs) git add -f libs fi - ./build/set-fs-version.sh "$uver" && git add configure.in + ./build/set-fs-version.sh "$uver" "$hrev" && git add configure.in echo "$uver" > .version && git add -f .version git commit --allow-empty -m "nightly v$uver" git archive -v \