From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 27 Nov 2025 15:05:31 +0000 (-0500) Subject: Improve error reporting for curl->sha256sum X-Git-Tag: rec-5.4.0-beta1~45^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cecf204d125aea3e1b9e77586120dc900707413;p=thirdparty%2Fpdns.git Improve error reporting for curl->sha256sum Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- diff --git a/builder-support/helpers/install_h2o.sh b/builder-support/helpers/install_h2o.sh index 7c704606cd..cb8366ab06 100755 --- a/builder-support/helpers/install_h2o.sh +++ b/builder-support/helpers/install_h2o.sh @@ -12,7 +12,13 @@ echo $0: Downloading $H2O_TARBALL curl -f -L -o "${H2O_TARBALL}" "${H2O_TARBALL_URL}" # Line below should echo two spaces between digest and name -echo "${H2O_TARBALL_HASH}" "${H2O_TARBALL}" | sha256sum -c - +if echo "${H2O_TARBALL_HASH} ${H2O_TARBALL}" | sha256sum -c -; then + true +else + result=$? + echo "error: Downloaded ${H2O_TARBALL_URL} failed sha256sum validation" + exit $result +fi tar xf "${H2O_TARBALL}" CFLAGS='-fPIC' cmake -DWITH_PICOTLS=off -DWITH_BUNDLED_SSL=off -DWITH_MRUBY=off -DCMAKE_INSTALL_PREFIX=/opt ./h2o-${H2O_VERSION} make -j $(nproc) diff --git a/builder-support/helpers/install_meson.sh b/builder-support/helpers/install_meson.sh index e74a0b0e40..4ae2b9554f 100755 --- a/builder-support/helpers/install_meson.sh +++ b/builder-support/helpers/install_meson.sh @@ -14,7 +14,13 @@ echo $0: Downloading ${MESON_TARBALL} curl -L -o "${MESON_TARBALL}" "${MESON_TARBALL_URL}" echo $0: Checking that the hash of ${MESON_TARBALL} is ${MESON_TARBALL_HASH} # Line below should echo two spaces between digest and name -echo "${MESON_TARBALL_HASH}"" ""${MESON_TARBALL}" | sha256sum -c - +if echo "${MESON_TARBALL_HASH} ${MESON_TARBALL}" | sha256sum -c -; then + true +else + result=$? + echo "error: Downloaded ${MESON_TARBALL_URL} failed sha256sum validation" + exit $result +fi tar xf "${MESON_TARBALL}" cd "meson-${MESON_VERSION}" diff --git a/builder-support/helpers/install_quiche.sh b/builder-support/helpers/install_quiche.sh index a098b808b2..cd9fc58b0b 100755 --- a/builder-support/helpers/install_quiche.sh +++ b/builder-support/helpers/install_quiche.sh @@ -36,7 +36,13 @@ echo $0: Downloading ${QUICHE_TARBALL} curl -L -o "${QUICHE_TARBALL}" "${QUICHE_TARBALL_URL}" echo $0: Checking that the hash of ${QUICHE_TARBALL} is ${QUICHE_TARBALL_HASH} # Line below should echo two spaces between digest and name -echo "${QUICHE_TARBALL_HASH}"" ""${QUICHE_TARBALL}" | sha256sum -c - +if echo "${QUICHE_TARBALL_HASH} ${QUICHE_TARBALL}" | sha256sum -c -; then + true +else + result=$? + echo "error: Downloaded ${QUICHE_TARBALL_URL} failed sha256sum validation" + exit $result +fi tar xf "${QUICHE_TARBALL}" cd "quiche-${QUICHE_VERSION}" # Disable SONAME in the quiche shared library, we do not intend this library to be used by anyone else and it makes things more complicated since we rename it to libdnsdist-quiche diff --git a/builder-support/helpers/install_rust.sh b/builder-support/helpers/install_rust.sh index 827c70e482..706d200422 100755 --- a/builder-support/helpers/install_rust.sh +++ b/builder-support/helpers/install_rust.sh @@ -46,7 +46,13 @@ else fi echo $0: Expecting hash $VALUE # Line below should echo two spaces between digest and name -echo $VALUE" "$RUST_TARBALL | sha256sum -c - +if echo "${VALUE} ${RUST_TARBALL}" | sha256sum -c -; then + true +else + result=$? + echo "error: Downloaded ${SITE}/${RUST_TARBALL} failed sha256sum validation" + exit $result +fi rm -rf $RUST_VERSION tar -Jxf $RUST_TARBALL cd $RUST_VERSION