Improve error message for checksum failure

This commit is contained in:
syeopite 2024-02-19 15:16:33 -08:00
parent 34ae6f4aa2
commit dfd94f4f2e
No known key found for this signature in database
GPG key ID: A73C186DA3955A1A

View file

@ -116,8 +116,11 @@ class Dependency
end
private def validate_checksum(io)
if !CONFIG.skip_checksum && Digest::SHA1.hexdigest(io) != @config.shasum
raise IO::Error.new("Checksum for '#{@dependency}' failed")
return if CONFIG.skip_checksum
digest = Digest::SHA1.hexdigest(io)
if digest != @config.shasum
raise IO::Error.new("Checksum for '#{@dependency}' failed. \"#{digest}\" does not match configured \"#{@config.shasum}\"")
end
end