Adding update to checksum check function to always filter the checksum file based on downloaded file. Adding CYGWIN croc_os switch for windows support (needs more testing)

This commit is contained in:
Micheal Quinn 2019-08-13 22:28:26 -05:00
parent 081e267a19
commit a72172d11e
No known key found for this signature in database
GPG Key ID: 0E7217F3C30BA059
1 changed files with 5 additions and 1 deletions

View File

@ -240,7 +240,10 @@ checksum_check() {
cd "${dir}" || return 3
if command -v sha256sum >/dev/null 2>&1; then
sha256sum -c "${checksum_file}" --ignore-missing >/dev/null 2>&1
## Not all sha256sum versions seem to have --ignore-missing, so filter the checksum file
## to only include the file we downloaded.
grep "$(basename "${file}")" "${checksum_file}" > filtered_checksum.txt
sha256sum -c "filtered_checksum.txt" >/dev/null 2>&1
rcode="${?}"
elif command -v shasum >/dev/null 2>&1; then
## With shasum on FreeBSD, we don't get to --ignore-missing, so filter the checksum file
@ -459,6 +462,7 @@ main() {
case "${croc_os}" in
"Darwin" ) croc_os="macOS";;
"CYGWIN"* ) croc_os="Windows";;
esac
case "${croc_arch}" in