From 57270d7b8ef1bab0d37fbe2300199c012d566166 Mon Sep 17 00:00:00 2001 From: Tomoe Sugihara Date: Wed, 19 Nov 2014 15:21:09 +0900 Subject: [PATCH] Support timestamp based package names for nightlies Change-Id: Ibad230f6d82aad146d011a25dfc529f6c6f3b5c4 --- package.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/package.sh b/package.sh index 9e21476..38ee278 100755 --- a/package.sh +++ b/package.sh @@ -14,7 +14,10 @@ # This script generates RPM and debian packages. # -# Usage: ./package.sh [VERSION_TAG] +# Usage: ./package.sh [-t] [VERSION_TAG] +# +# +# -t: use timestamp based package name for unstable packges. # # VERSION_TAG: Tag to determine version and revision string for # deb and RPM packages. @@ -24,6 +27,15 @@ set -e +while getopts t OPT; do + case "$OPT" in + t) + USE_TIMESTAMP=yes + shift + ;; + esac +done + # Get version tag from command line or defaults to use git describe version_tag=$1 if [ "$version_tag" == "" ]; then @@ -61,7 +73,12 @@ elif [[ "$version_tag" =~ ^([0-9]{4}\.[0-9]+)\+([0-9]+\.[0-9])\.(rc[0-9]+.*)$ ]] echo Producing unstable packages for tag: $version_tag upstream_version=${BASH_REMATCH[1]} downstream_version=${BASH_REMATCH[2]} - pre_release_tag=$(echo ${BASH_REMATCH[3]} | sed -e 's/-/./g') + + if [ "$USE_TIMESTAMP" == "yes" ]; then + pre_release_tag=$(date '+%Y%m%d%H%M') + else + pre_release_tag=$(echo ${BASH_REMATCH[3]} | sed -e 's/-/./g') + fi rpm_version=$upstream_version+$downstream_version rpm_revision="0."$pre_release_tag