File: version-is-release

package info (click to toggle)
linuxcnc 1%3A2.9.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 285,604 kB
  • sloc: python: 202,568; ansic: 109,036; cpp: 99,239; tcl: 16,054; xml: 10,631; sh: 10,303; makefile: 1,255; javascript: 138; sql: 72; asm: 15
file content (34 lines) | stat: -rwxr-xr-x 769 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#
# This script checks if the current version (HEAD) is an official release.
# If so, the program returns with an exit code of 0 (True).  If it is not a
# release, the program returns an exit code other than 0 (False).
#
# HEAD is an official release if there exists a tag that points to it and
# that is signed by the release manager's key.
#

if [ ! -z "$EMC2_HOME" ]; then
    source $EMC2_HOME/scripts/githelper.sh
else
    source $(git rev-parse --show-toplevel)/scripts/githelper.sh
fi

githelper $1
if [ -z "$GIT_TAG" ]; then
    # no signed tags found
    echo "no"
    exit 1
fi

TAGGED_REV=$(git rev-parse $GIT_TAG^{commit})
HEAD_REV=$(git rev-parse HEAD)

if [ "$TAGGED_REV" == "$HEAD_REV" ]; then
    echo "yes"
    exit 0
fi

echo "no"
exit 1