]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Improve error reporting for curl->sha256sum
authorJosh Soref <2119212+jsoref@users.noreply.github.com>
Thu, 27 Nov 2025 15:05:31 +0000 (10:05 -0500)
committerJosh Soref <2119212+jsoref@users.noreply.github.com>
Wed, 14 Jan 2026 13:36:01 +0000 (08:36 -0500)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
builder-support/helpers/install_h2o.sh
builder-support/helpers/install_meson.sh
builder-support/helpers/install_quiche.sh
builder-support/helpers/install_rust.sh

index 7c704606cd952d623ea0b0ec24bf6dc3a9f2ddb2..cb8366ab06852122187d54e96183b17f19232488 100755 (executable)
@@ -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)
index e74a0b0e40d313dc3aa058ff7c6cf8611f83e6e2..4ae2b9554f521e7935787b094852e5a87796052f 100755 (executable)
@@ -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}"
 
index a098b808b24edd1140204f35c90b3c9ceb7ae17b..cd9fc58b0b78d9373e5c7af54fd994b33bcaa432 100755 (executable)
@@ -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
index 827c70e4820acf57ce8348ff04cbcd83ad318379..706d2004229f86c5fecfa1e43f09d1297ff26394 100755 (executable)
@@ -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