aboutsummaryrefslogtreecommitdiff
path: root/contrib/gitian-descriptors/assign_DISTNAME
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gitian-descriptors/assign_DISTNAME')
-rwxr-xr-xcontrib/gitian-descriptors/assign_DISTNAME12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/gitian-descriptors/assign_DISTNAME b/contrib/gitian-descriptors/assign_DISTNAME
new file mode 100755
index 0000000000..a1ab3f7cbd
--- /dev/null
+++ b/contrib/gitian-descriptors/assign_DISTNAME
@@ -0,0 +1,12 @@
+# Copyright (c) 2020 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#
+# A helper script to be sourced into the gitian descriptors
+
+if RECENT_TAG="$(git describe --exact-match HEAD)"; then
+ VERSION="${RECENT_TAG#v}"
+else
+ VERSION="$(git rev-parse --short HEAD)"
+fi
+DISTNAME="bitcoin-${VERSION}"