Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-02-18 12:45:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-02-18 12:45:46 +0300
commita7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch)
tree7452bd5c3545c2fa67a28aa013835fb4fa071baf /workhorse/_support
parentee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff)
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'workhorse/_support')
-rwxr-xr-xworkhorse/_support/make-gnu-build-id.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/workhorse/_support/make-gnu-build-id.sh b/workhorse/_support/make-gnu-build-id.sh
new file mode 100755
index 00000000000..815966dab7e
--- /dev/null
+++ b/workhorse/_support/make-gnu-build-id.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+main()
+{
+ GO_BINARY=$1
+
+ if [ $# -ne 1 ] || [ ! -f $GO_BINARY ] ; then
+ fail "Usage: $0 [path_to_go_binary]"
+ fi
+
+ GO_BUILD_ID=$( go tool buildid "$GO_BINARY" || openssl rand -hex 32 )
+ if [ -z "$GO_BUILD_ID" ] ; then
+ fail "ERROR: Could not extract Go build-id or generate a random hex string."
+ fi
+
+ GNU_BUILD_ID=$( echo $GO_BUILD_ID | sha1sum | cut -d' ' -f1 )
+ if [ -z "$GNU_BUILD_ID" ] ; then
+ fail "ERROR: Could not generate a GNU build-id"
+ fi
+
+ echo "$GNU_BUILD_ID"
+}
+
+fail()
+{
+ echo "$@" 1>&2
+ exit 1
+}
+
+main "$@"