blob: bbafb9bbf8fd20367cc2b031dd981da41d98355e [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001#!/bin/bash
2
3TAG=$(git describe | cut -d- -f1 | sed -e 's/^v//')
4ADD=$(git describe | cut -s -d- -f2)
5CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4)
6
7if [ "$1" = "rpm-version" ]; then
8 echo ${TAG}
9 exit
10fi
11
12if [ "$1" = "rpm-release" ]; then
13 [ -z "${ADD}" ] && echo release && exit
Dave Barach0e5e3c32016-01-25 08:28:22 -050014 CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4 | sed 's/-/_/')
Ed Warnickecb9cada2015-12-08 15:45:58 -070015 echo ${ADD}~${CMT}
16 exit
17fi
18
19if [ -n "${ADD}" ]; then
20 echo ${TAG}-${ADD}~${CMT}
21else
22 echo ${TAG}
23fi