summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/tools/version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/tools/version.sh')
-rw-r--r--libc-top-half/musl/tools/version.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/libc-top-half/musl/tools/version.sh b/libc-top-half/musl/tools/version.sh
new file mode 100644
index 0000000..f1cc594
--- /dev/null
+++ b/libc-top-half/musl/tools/version.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if test -d .git ; then
+if type git >/dev/null 2>&1 ; then
+git describe --tags --match 'v[0-9]*' 2>/dev/null \
+| sed -e 's/^v//' -e 's/-/-git-/'
+else
+sed 's/$/-git/' < VERSION
+fi
+else
+cat VERSION
+fi