File: version.sh

package info (click to toggle)
libxs 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 6,136 kB
  • ctags: 2,159
  • sloc: cpp: 16,233; sh: 10,244; ansic: 405; makefile: 354
file content (21 lines) | stat: -rwxr-xr-x 764 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
#
# This script extracts the Crossroads version from include/xs.h,
# which is the master location for this information.
#
if [ ! -f include/xs/xs.h ]; then
    echo "version.sh: error: include/xs/xs.h does not exist" 1>&2
    exit 1
fi
MAJOR=`egrep '^#define +XS_VERSION_MAJOR +[0-9]+$' include/xs/xs.h`
MINOR=`egrep '^#define +XS_VERSION_MINOR +[0-9]+$' include/xs/xs.h`
PATCH=`egrep '^#define +XS_VERSION_PATCH +[0-9]+$' include/xs/xs.h`
if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then
    echo "version.sh: error: could not extract version from include/xs/xs.h" 1>&2
    exit 1
fi
MAJOR=`echo $MAJOR | awk '{ print $3 }'`
MINOR=`echo $MINOR | awk '{ print $3 }'`
PATCH=`echo $PATCH | awk '{ print $3 }'`
echo $MAJOR.$MINOR.$PATCH | tr -d '\n'