summaryrefslogtreecommitdiffstats
path: root/packaging/makeself/functions.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-01 06:15:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-01 06:15:11 +0000
commit483926a283e118590da3f9ecfa75a8a4d62143ce (patch)
treecb77052778df9a128a8cd3ff5bf7645322a13bc5 /packaging/makeself/functions.sh
parentReleasing debian version 1.31.0-4. (diff)
downloadnetdata-483926a283e118590da3f9ecfa75a8a4d62143ce.tar.xz
netdata-483926a283e118590da3f9ecfa75a8a4d62143ce.zip
Merging upstream version 1.32.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/makeself/functions.sh')
-rwxr-xr-xpackaging/makeself/functions.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/packaging/makeself/functions.sh b/packaging/makeself/functions.sh
index 15818d3b2..afc8a9ac9 100755
--- a/packaging/makeself/functions.sh
+++ b/packaging/makeself/functions.sh
@@ -29,13 +29,25 @@ set -euo pipefail
# -----------------------------------------------------------------------------
fetch() {
- local dir="${1}" url="${2}"
+ local dir="${1}" url="${2}" sha256="${3}"
local tar="${dir}.tar.gz"
if [ ! -f "${NETDATA_MAKESELF_PATH}/tmp/${tar}" ]; then
run wget -O "${NETDATA_MAKESELF_PATH}/tmp/${tar}" "${url}"
fi
+ # Check SHA256 of gzip'd tar file (apparently alpine's sha256sum requires
+ # two empty spaces between the checksum and the file's path)
+ set +e
+ echo "${sha256} ${NETDATA_MAKESELF_PATH}/tmp/${tar}" | sha256sum -c -s
+ local rc=$?
+ if [ ${rc} -ne 0 ]; then
+ echo >&2 "SHA256 verification of tar file ${tar} failed (rc=${rc})"
+ echo >&2 "expected: ${sha256}, got $(sha256sum "${NETDATA_MAKESELF_PATH}/tmp/${tar}")"
+ exit 1
+ fi
+ set -e
+
if [ ! -d "${NETDATA_MAKESELF_PATH}/tmp/${dir}" ]; then
cd "${NETDATA_MAKESELF_PATH}/tmp"
run tar -zxpf "${tar}"