aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorDominyk Tiller2015-02-24 23:25:57 +0000
committerMike McQuaid2015-03-05 14:45:39 +0000
commit0223fa1437af76fb4913373fd20b380c9309c51a (patch)
tree376a906b401793a761849e26ad2dbcdf0b8ffe79 /Library/Homebrew/cmd
parentf4a267d500a12288a971776b281550a7c2fe591c (diff)
downloadhomebrew-0223fa1437af76fb4913373fd20b380c9309c51a.tar.bz2
checksums: switch to sha256 for bottles and new formulae
Closes #37164. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/audit.rb10
-rw-r--r--Library/Homebrew/cmd/bottle.rb2
-rw-r--r--Library/Homebrew/cmd/create.rb6
3 files changed, 12 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index eefbf8286..2354cb3c2 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -846,9 +846,15 @@ class ResourceAuditor
case checksum.hash_type
when :md5
- problem "MD5 checksums are deprecated, please use SHA1 or SHA256"
+ problem "MD5 checksums are deprecated, please use SHA256"
return
- when :sha1 then len = 40
+ when :sha1
+ if ARGV.include? "--strict"
+ problem "SHA1 checksums are deprecated, please use SHA256"
+ return
+ else
+ len = 40
+ end
when :sha256 then len = 64
end
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index dcbc0e2ce..77b75ed82 100644
--- a/Library/Homebrew/cmd/bottle.rb
+++ b/Library/Homebrew/cmd/bottle.rb
@@ -202,7 +202,7 @@ module Homebrew
bottle.prefix prefix
bottle.cellar relocatable ? :any : cellar
bottle.revision bottle_revision
- bottle.sha1 bottle_path.sha1 => bottle_tag
+ bottle.sha256 bottle_path.sha256 => bottle_tag
output = bottle_output bottle
diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb
index 3f169be21..b9bc9cd13 100644
--- a/Library/Homebrew/cmd/create.rb
+++ b/Library/Homebrew/cmd/create.rb
@@ -73,7 +73,7 @@ module Homebrew
end
class FormulaCreator
- attr_reader :url, :sha1
+ attr_reader :url, :sha256
attr_accessor :name, :version, :path, :mode
def url= url
@@ -112,7 +112,7 @@ class FormulaCreator
r.url(url)
r.version(version)
r.owner = self
- @sha1 = r.fetch.sha1 if r.download_strategy == CurlDownloadStrategy
+ @sha256 = r.fetch.sha256 if r.download_strategy == CurlDownloadStrategy
end
path.write ERB.new(template, nil, '>').result(binding)
@@ -129,7 +129,7 @@ class FormulaCreator
<% unless version.nil? or version.detected_from_url? %>
version "#{version}"
<% end %>
- sha1 "#{sha1}"
+ sha256 "#{sha256}"
<% if mode == :cmake %>
depends_on "cmake" => :build