diff options
author | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:29 +0100 |
---|---|---|
committer | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:29 +0100 |
commit | 2c416a793ea781273a5da6742211f5f01af13a2b (patch) | |
tree | b8ede23ec38d4aab9595a517b4b9894df40c2cae /version.sh | |
parent | 5ba1cb20fe6f6699cef1cc726718e760cd4c9af1 (diff) |
Imported Upstream version 2.0.10upstream/2.0.10
Diffstat (limited to 'version.sh')
-rwxr-xr-x | version.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..b88bb61 --- /dev/null +++ b/version.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# This script extracts the 0MQ version from include/zmq.h, which is the master +# location for this information. +# +if [ ! -f include/zmq.h ]; then + echo "version.sh: error: include/zmq.h does not exist" 1>&2 + exit 1 +fi +MAJOR=`egrep '^#define +ZMQ_VERSION_MAJOR +[0-9]+$' include/zmq.h` +MINOR=`egrep '^#define +ZMQ_VERSION_MINOR +[0-9]+$' include/zmq.h` +PATCH=`egrep '^#define +ZMQ_VERSION_PATCH +[0-9]+$' include/zmq.h` +if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then + echo "version.sh: error: could not extract version from include/zmq.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 + |