summaryrefslogtreecommitdiff
path: root/version.sh
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2010-10-21 16:21:20 +0200
committerMartin Lucina <martin@lucina.net>2012-01-23 08:53:31 +0100
commit3f0085ddbef1a44b6bb7a0b23af497d56e0025fa (patch)
tree0adac3a5b31b2a1d9a89ec5a797f34c1a3fdf27a /version.sh
parent90d73cba9cd1d1724f38ed82fc0eefb1781c9c20 (diff)
parent2c416a793ea781273a5da6742211f5f01af13a2b (diff)
Imported Debian patch 2.0.10-1debian/2.0.10-1
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh21
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
+