File: revision

package info (click to toggle)
spec-alpha-clojure 0.5.238-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 328 kB
  • sloc: xml: 146; sh: 41; makefile: 5
file content (19 lines) | stat: -rwxr-xr-x 457 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash

# Return the complete revision number
# <major>.<minor>.<trunk-basis>.<patch-or-0>-<sha>[-qualifier]

set -e

version_template=`cat VERSION_TEMPLATE`

if [[ "$version_template" =~ ^[0-9]+\.[0-9]+\.GENERATED_VERSION(-[a-zA-Z0-9]+)?$ ]]; then

    git_revision=`script/build/git_revision`
    echo ${version_template/GENERATED_VERSION/$git_revision}

else
    echo "Invalid version template string: $version_template" >&2
    exit -1
fi