aboutsummaryrefslogtreecommitdiff
path: root/version.sh
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-03-13 10:01:13 +0100
committerThomas White <taw@physics.org>2018-03-13 10:26:44 +0100
commitea8e7bc35e5c09096c04f5c269451a330d59c49b (patch)
treeed8fac715b989597e4f2815e5946eced89405a44 /version.sh
parent279ae2e0836a91f8bff0a225ceaf733d4e072aa7 (diff)
Nicer way of getting Git revision
This will need a separate way to create the official releases (which shouldn't have Git revisions attached)
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh30
1 files changed, 0 insertions, 30 deletions
diff --git a/version.sh b/version.sh
deleted file mode 100755
index ce74e37e..00000000
--- a/version.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-top_srcdir=$1
-
-CRYSTFEL_BASE_VERSION=$( cf=( `grep PACKAGE_VERSION config.h` ); echo ${cf[2]} | sed -n 's/"//gp' )
-sed 's/\$u\$/'${CRYSTFEL_BASE_VERSION}'/g' $top_srcdir/version.h.in > version1.tmp
-command -v git > /dev/null 2>&1
-if [ $? -eq 0 ]; then
- if [ -d ".git" ]; then
- git log -1 --pretty=%B | grep 'This is CrystFEL' > /dev/null
- if [ $? -eq 0 ]; then
- CRYSTFEL_GIT_COMMIT=""
- else
- CRYSTFEL_GIT_COMMIT="+"`git rev-parse HEAD`
- fi
- fi
-fi
-sed 's/\$e\$/'${CRYSTFEL_GIT_COMMIT}'/g' version1.tmp > version2.tmp
-if [ -f version.h ]; then
- diff version.h version2.tmp > /dev/null
- if [ $? -ne 0 ]; then
- mv version2.tmp version.h
- rm version1.tmp
- else
- rm version1.tmp version2.tmp
- fi
-else
- mv version2.tmp version.h
- rm version1.tmp
-fi