mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-09-06 09:11:48 +02:00
Move empty-checksum handling into case stmt
This commit is contained in:
parent
26af69a9d3
commit
a187b07dab
1 changed files with 5 additions and 5 deletions
|
@ -248,16 +248,16 @@ compute_md5() {
|
|||
|
||||
verify_checksum() {
|
||||
local checksum_command
|
||||
local filename="$1"
|
||||
local expected_checksum="$(echo "$2" | tr [A-Z] [a-z])"
|
||||
|
||||
# If the specified filename doesn't exist, return success
|
||||
local filename="$1"
|
||||
[ -e "$filename" ] || return 0
|
||||
|
||||
# If there's no expected checksum, return success
|
||||
local expected_checksum="$(echo "$2" | tr [A-Z] [a-z])"
|
||||
[ -n "$expected_checksum" ] || return 0
|
||||
|
||||
case "${#expected_checksum}" in
|
||||
0) # If there's no expected checksum, return success
|
||||
return 0
|
||||
;;
|
||||
32) # MD5
|
||||
[ -n "$HAS_MD5_SUPPORT" ] || return 0
|
||||
checksum_command="compute_md5"
|
||||
|
|
Loading…
Reference in a new issue