Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report SHA-256 hash (instead of SHA-1) if checksum is missing. #2840

Merged
merged 1 commit into from Feb 9, 2014

Conversation

lgarron
Copy link
Sponsor Contributor

@lgarron lgarron commented Feb 9, 2014

I accidentally missed this in #2719. Since SHA-256 is the suggested default, the suggested hash if there's one missing should presumably also be SHA-256.

I've checked the repo more thoroughly, and this seems to be the only significant thing missing from #2719 (although a lot of tests are still SHA-1).

@@ -29,6 +29,6 @@ def _check_sums(path, sums)
has_sum = true
end
end
raise ChecksumMissingError.new("Checksum required. SHA1: '#{Digest::SHA1.file(path).hexdigest}'") unless has_sum
raise ChecksumMissingError.new("Checksum required. SHA-256: '#{Digest::SHA256.file(path).hexdigest}'") unless has_sum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about a copy and paste ready error message with a quickfix:

Checksum required. add this line to the cask file: 
    sha256 '#{Digest::SHA256.file(path).hexdigest}'

@muescha
Copy link
Contributor

muescha commented Feb 9, 2014

this detailed message (with quickfix) should also go top the audit cli command?

@rolandwalker
Copy link
Contributor

👍

rolandwalker added a commit that referenced this pull request Feb 9, 2014
Report SHA-256 hash (instead of SHA-1) if checksum is missing.
@rolandwalker rolandwalker merged commit 5176cba into Homebrew:master Feb 9, 2014
@lgarron lgarron deleted the sha-256-if-missing-hash branch February 11, 2014 04:56
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants