File: version.sh

package info (click to toggle)
meep-openmpi 1.25.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 64,556 kB
  • sloc: cpp: 32,214; python: 27,958; lisp: 1,225; makefile: 505; sh: 249; ansic: 131; javascript: 5
file content (24 lines) | stat: -rwxr-xr-x 549 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
#
# Build a version number, possibly including the Git revision number. Called
# from configure.ac via AC_INIT.
#

#set -x

VERSION=$1
TAG=$2

# Include the Git revision when the release tag is "alpha"
if [ "$TAG" = "alpha" -a -e .git ]; then
    REV=$(git rev-parse --short=6 HEAD)
fi

# Print the version string, depending on how many components are available
if [ "$TAG" != "" -a "$REV" != "" ]; then
    printf "%s-%s.%s" $VERSION $TAG $REV
elif [ "$TAG" != "" ]; then
    printf "%s-%s" $VERSION $TAG
else
    printf "%s" $VERSION
fi