Index: Setup/updateFileInfo.tcl
==================================================================
--- Setup/updateFileInfo.tcl
+++ Setup/updateFileInfo.tcl
@@ -34,15 +34,15 @@
return [format %.2f [expr {[file size $fileName] / 1048576.0}]]
}
proc getFileHash { fileName } {
#
- # NOTE: Return the SHA1 hash of the file, making use of Fossil via [exec] to
+ # NOTE: Return the SHA3 hash of the file, making use of Fossil via [exec] to
# actually calculate it.
#
- return [string trim [lindex [regexp -inline -nocase -- {[0-9A-F]{40} } \
- [exec fossil sha1sum $fileName]] 0]]
+ return [string trim [lindex [regexp -inline -nocase -- {[0-9A-F]{56} } \
+ [exec fossil sha3sum $fileName]] 0]]
}
#
# NOTE: Grab the fully qualified directory name of the directory containing
# this script file.
@@ -83,26 +83,26 @@
}
#
# NOTE: Setup the regular expression patterns with the necessary captures.
# These patterns are mostly non-greedy; however, at the end we need to
-# match exactly 40 hexadecimal characters. In theory, in Tcl, this could
+# match exactly 56 hexadecimal characters. In theory, in Tcl, this could
# have an undefined result due to the mixing of greedy and non-greedy
# quantifiers; however, in practice, this seems to work properly. Also,
# this pattern assumes a particular structure for the [HTML] file to be
# updated.
#
set pattern1 {.*?\((\d+?\.\d+?) MiB\).*?sha1:\
- ([0-9A-F]{40})}
+ href=".*?/(.*?\.(?:exe|zip|nupkg))">.*?\((\d+?\.\d+?) MiB\).*?sha3:\
+ ([0-9A-F]{56})}
set pattern2 {(.*?).*?\((\d+?\.\d+?)\
- MiB\).*?sha1: ([0-9A-F]{40})}
+ MiB\).*?sha3: ([0-9A-F]{56})}
set pattern3 {href="/downloads/(.*?)"}
-set pattern4 {\(sha1: ([0-9A-F]{40})\)}
+set pattern4 {\(sha3: ([0-9A-F]{56})\)}
set pattern5 {\((\d+?\.\d+?) MiB\)}
#
# NOTE: Grab all the data from the file to be updated.
#
@@ -183,11 +183,11 @@
}
}
}
#
-# NOTE: Attempt to verify that each file name now has the correct SHA1 hash
+# NOTE: Attempt to verify that each file name now has the correct SHA3 hash
# associated with it on the page.
#
foreach {dummy3 fileName} [regexp -all -inline -nocase -- $pattern3 $data] \
{dummy4 fileHash} [regexp -all -inline -nocase -- $pattern4 $data] \
{dummy5 fileSize} [regexp -all -inline -nocase -- $pattern5 $data] {
@@ -210,11 +210,11 @@
# calculated hash for the file. If not, fail.
#
set fullFileHash [getFileHash $fullFileName]
if {$fileHash ne $fullFileHash} then {
- puts stdout "ERROR: SHA1 hash mismatch for\
+ puts stdout "ERROR: SHA3 hash mismatch for\
file \"$fullFileName\", have \"$fileHash\" (from data),\
need \"$fullFileHash\" (calculated)."
}
set fullFileSize [getFileSize $fullFileName]