Skip to content

Commit

Permalink
Support timestamp based package names for nightlies
Browse files Browse the repository at this point in the history
Change-Id: Ibad230f6d82aad146d011a25dfc529f6c6f3b5c4
  • Loading branch information
Tomoe Sugihara committed Nov 19, 2014
1 parent bced88a commit 57270d7
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 57270d7

Please sign in to comment.