File: dynver.sh

package info (click to toggle)
snappy-java 1.1.10.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 4,292 kB
  • sloc: java: 5,739; sh: 2,506; xml: 431; cpp: 295; makefile: 199
file content (21 lines) | stat: -rwxr-xr-x 670 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# Compute sbt-dynver-compatible version number
BUILD_TIME=`date '+%Y%m%d-%H%M'`
DYN_VER=`git describe --long --tags --abbrev=8 --match "v[0-9]*" --always --dirty="-${BUILD_TIME}"`
GIT_DIST=`echo ${DYN_VER} | sed -re "s/v([^-]*)-([0-9]+)-g(.*)/\2/g"`
GIT_TAG=`git describe --tags --dirty`
RELEASE_VERSION=`echo ${DYN_VER} | sed -re "s/v([^-]*)-([0-9]+)-g(.*)/\1/g"`
SNAPSHOT_VERSION=`echo ${DYN_VER} | sed -re "s/v([^-]*)-([0-9]+)-g(.*)/\1-\2-\3/g"`-SNAPSHOT

if [ ${GIT_DIST} -eq 0 ]; then
  if [ ${GIT_TAG} == *"-dirty" ]; then
    VERSION=${SNAPSHOT_VERSION}
  else
    VERSION=${RELEASE_VERSION}
  fi
else
  VERSION=${SNAPSHOT_VERSION}
fi

echo ${VERSION}