svn commit: r1935200 - httpd/docs-build/trunk

[email protected] Thu, 11 Jun 2026 13:37:02 -0000
Newsgroups gmane.comp.apache.cvs
Message-ID <178118502218.810214.15093427055417989744@svn03-he-fi>
Author: rbowen
Date: Thu Jun 11 13:37:01 2026
New Revision: 1935200

Log:
Sorry, I got confused. They only provide md5/sha1 (yikes) not sha256 or better.

Modified:
   httpd/docs-build/trunk/build.sh

Modified: httpd/docs-build/trunk/build.sh
==============================================================================
--- httpd/docs-build/trunk/build.sh	Thu Jun 11 13:33:19 2026	(r1935199)
+++ httpd/docs-build/trunk/build.sh	Thu Jun 11 13:37:01 2026	(r1935200)
@@ -141,27 +141,27 @@ fi
 # --- Ensure vnu.jar is present and up-to-date ---
 VNU_JAR="${ANT_HOME}/vnu.jar"
 VNU_URL="https://github.com/validator/validator/releases/download/latest/vnu.jar"
+VNU_MD5_URL="https://github.com/validator/validator/releases/download/latest/vnu.jar.md5"
 
-# Get the expected SHA-256 from the GitHub release metadata
-VNU_REMOTE_SHA=$(curl -sfL "https://api.github.com/repos/validator/validator/releases/latest" \
-    | grep -A2 '"name":"vnu.jar"' | grep '"digest"' \
-    | sed 's/.*"sha256:\([a-f0-9]*\)".*/\1/')
+# Get the expected MD5 from the published checksum file
+VNU_REMOTE_MD5=$(curl -sfL "$VNU_MD5_URL" | awk '{print $1}')
 
-if [ -z "$VNU_REMOTE_SHA" ]; then
-    echo "Warning: could not determine latest vnu.jar checksum from GitHub."
+if [ -z "$VNU_REMOTE_MD5" ]; then
+    echo "Warning: could not fetch latest vnu.jar checksum from GitHub."
     if [ ! -f "$VNU_JAR" ]; then
         echo "  vnu.jar is missing and cannot be fetched. HTML validation will be skipped."
     else
         echo "  Continuing with existing vnu.jar."
     fi
 else
-    # Compute local SHA-256 (if file exists)
-    VNU_LOCAL_SHA=""
+    # Compute local MD5 (if file exists)
+    VNU_LOCAL_MD5=""
     if [ -f "$VNU_JAR" ]; then
-        VNU_LOCAL_SHA=$(shasum -a 256 "$VNU_JAR" | cut -d' ' -f1)
+        VNU_LOCAL_MD5=$(md5sum "$VNU_JAR" 2>/dev/null || md5 -q "$VNU_JAR" 2>/dev/null)
+        VNU_LOCAL_MD5=$(echo "$VNU_LOCAL_MD5" | awk '{print $1}')
     fi
 
-    if [ "$VNU_LOCAL_SHA" = "$VNU_REMOTE_SHA" ]; then
+    if [ "$VNU_LOCAL_MD5" = "$VNU_REMOTE_MD5" ]; then
         echo "vnu.jar is up-to-date."
     else
         echo "Fetching latest vnu.jar ..."