Verify pkg hash
coatless opened this issue · 0 comments
coatless commented
Per Simon's e-mail on R-SIG-MAC, we're going to implement a check that verifies the md5 hash of the file.
Sample function:
#1 Path to File
#2 md5 Hash to Check Against
check_md5_hash() {
# Obtain file hash
FILE_HASH=$(md5 $1 | awk '{print $4}')
# MD5 (path/to/file.pkg) = c29700c4e7b2914073ef7e741eb105bc
# 1 % 2 %3% 4
# Check against hash
if [ "$FILE_HASH" = "$2" ]; then
echo 0
else
exit 1
fi
}
Hard coded hashes:
- clang-4.0.0-darwin15.6-Release.tar.gz:
2bec4fbae8d9caf6499c941ef9b87eae
- Downloaded from: http://r.research.att.com/libs/clang-4.0.0-darwin15.6-Release.tar.gz
- gfortran (OS dependent)
- gfortran-6.1-ElCapitan.dmg:
457b59a6453069cf72dee9a4f9bf1b0a
- Downloaded from: http://coudert.name/software/gfortran-6.1-ElCapitan.dmg
- gfortran-6.3-Sierra.dmg:
1849cea667bb714c5c04a8565a9fe231
- Downloaded from: http://coudert.name/software/gfortran-6.3-Sierra.dmg
- gfortran-6.1-ElCapitan.dmg: