Verify checksums of makeself deps. (#11791)
vkalintiris committed
Nov 16, 2021 at 16:25 UTC
60a2afc13994e3bce41aa44b42a3f770f45a5bba
5 files changed
+21
-5
packaging/makeself/functions.sh
+13
-1
@@ -29,13 +29,25 @@ set -euo pipefail
29
# -----------------------------------------------------------------------------
30
31
fetch() {
32
- local dir="${1}" url="${2}"
32
+ local dir="${1}" url="${2}" sha256="${3}"
33
local tar="${dir}.tar.gz"
34
35
if [ ! -f "${NETDATA_MAKESELF_PATH}/tmp/${tar}" ]; then
36
run wget -O "${NETDATA_MAKESELF_PATH}/tmp/${tar}" "${url}"
37
fi
38
39
+ # Check SHA256 of gzip'd tar file (apparently alpine's sha256sum requires
40
+ # two empty spaces between the checksum and the file's path)
41
+ set +e
42
+ echo "${sha256} ${NETDATA_MAKESELF_PATH}/tmp/${tar}" | sha256sum -c -s
43
+ local rc=$?
44
+ if [ ${rc} -ne 0 ]; then
45
+ echo >&2 "SHA256 verification of tar file ${tar} failed (rc=${rc})"
46
+ echo >&2 "expected: ${sha256}, got $(sha256sum "${NETDATA_MAKESELF_PATH}/tmp/${tar}")"
47
+ exit 1
48
+ fi
49
+ set -e
50
+
51
if [ ! -d "${NETDATA_MAKESELF_PATH}/tmp/${dir}" ]; then
52
cd "${NETDATA_MAKESELF_PATH}/tmp"
53
run tar -zxpf "${tar}"
packaging/makeself/jobs/50-bash-5.1.8.install.sh
+2
-1
@@ -6,7 +6,8 @@
6
7
[ -n "${GITHUB_ACTIONS}" ] && echo "::group::building bash"
8
9
-fetch "bash-5.1.8" "http://ftp.gnu.org/gnu/bash/bash-5.1.8.tar.gz"
9
+fetch "bash-5.1.8" "http://ftp.gnu.org/gnu/bash/bash-5.1.8.tar.gz" \
10
+ 0cfb5c9bb1a29f800a97bd242d19511c997a1013815b805e0fdd32214113d6be
11
12
export PKG_CONFIG_PATH="/openssl-static/lib/pkgconfig"
13
packaging/makeself/jobs/50-curl-7.78.0.install.sh
+2
-1
@@ -6,7 +6,8 @@
6
7
[ -n "${GITHUB_ACTIONS}" ] && echo "::group::Building cURL"
8
9
-fetch "curl-7.78.0" "https://curl.haxx.se/download/curl-7.78.0.tar.gz"
9
+fetch "curl-7.78.0" "https://curl.haxx.se/download/curl-7.78.0.tar.gz" \
10
+ ed936c0b02c06d42cf84b39dd12bb14b62d77c7c4e875ade022280df5dcc81d7
11
12
export CFLAGS="-I/openssl-static/include"
13
export LDFLAGS="-static -L/openssl-static/lib"
packaging/makeself/jobs/50-fping-5.0.install.sh
+2
-1
@@ -6,7 +6,8 @@
6
7
[ -n "${GITHUB_ACTIONS}" ] && echo "::group::Building fping"
8
9
-fetch "fping-5.0" "https://fping.org/dist/fping-5.0.tar.gz"
9
+fetch "fping-5.0" "https://fping.org/dist/fping-5.0.tar.gz" \
10
+ ed38c0b9b64686a05d1b3bc1d66066114a492e04e44eef1821d43b1263cd57b8
11
12
export CFLAGS="-static -I/openssl-static/include"
13
export LDFLAGS="-static -L/openssl-static/lib"
packaging/makeself/jobs/50-ioping-1.2.install.sh
+2
-1
@@ -6,7 +6,8 @@
6
7
[ -n "${GITHUB_ACTIONS}" ] && echo "::group::Building ioping"
8
9
-fetch "ioping-1.2" "https://github.com/koct9i/ioping/archive/v1.2.tar.gz"
9
+fetch "ioping-1.2" "https://github.com/koct9i/ioping/archive/v1.2.tar.gz" \
10
+ d3e4497c653a1e96df67c72ce2b70da18e9f5e3b93179a5bb57a6e30ceacfa75
11
12
export CFLAGS="-static"
13