summaryrefslogtreecommitdiff
path: root/utils/gen-version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'utils/gen-version.sh')
-rwxr-xr-xutils/gen-version.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/gen-version.sh b/utils/gen-version.sh
index d0048179..eb7c7268 100755
--- a/utils/gen-version.sh
+++ b/utils/gen-version.sh
@@ -6,6 +6,15 @@
build_dir="$1"
src_dir="$2"
+# If .tarball-version exists, output the version string from the file and exit.
+# This file is auto-generated on a 'meson dist' command from the run-dist.sh
+# script.
+if [ -n "$src_dir" ] && [ -f "$src_dir"/.tarball-version ]
+then
+ cat "$src_dir"/.tarball-version
+ exit 0
+fi
+
# Bail out if the directory isn't under git control
git_dir=$(git rev-parse --git-dir 2>&1) || exit 1