mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-08 23:18:10 -05:00
Change crew and lib/package.rb to support sha256. Currently crew check either sha256 or sha1.
This commit is contained in:
7
crew
7
crew
@@ -363,12 +363,16 @@ def download
|
||||
filename = File.basename(uri.path)
|
||||
if source
|
||||
sha1sum = @pkg.source_sha1
|
||||
sha256sum = @pkg.source_sha256
|
||||
else
|
||||
sha1sum = @pkg.binary_sha1[@device[:architecture]]
|
||||
sha256sum = @pkg.binary_sha256[@device[:architecture]]
|
||||
end
|
||||
Dir.chdir CREW_BREW_DIR do
|
||||
system('wget', '--continue', '--no-check-certificate', url, '-O', filename)
|
||||
abort 'Checksum mismatch. :/ Try again.'.lightred unless Digest::SHA1.hexdigest( File.read("./#{filename}") ) == sha1sum
|
||||
abort 'Checksum mismatch. :/ Try again.'.lightred unless
|
||||
Digest::SHA1.hexdigest( File.read("./#{filename}") ) == sha1sum or
|
||||
Digest::SHA256.hexdigest( File.read("./#{filename}") ) == sha256sum
|
||||
end
|
||||
puts "Archive downloaded".lightgreen
|
||||
return {source: source, filename: filename}
|
||||
@@ -658,6 +662,7 @@ def archive_package (pwd)
|
||||
end
|
||||
Dir.chdir pwd do
|
||||
system "sha1sum #{pkg_name} > #{pkg_name}.sha1"
|
||||
system "sha256sum #{pkg_name} > #{pkg_name}.sha256"
|
||||
end
|
||||
puts "#{pkg_name} is built!".lightgreen
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require 'package_helpers'
|
||||
|
||||
class Package
|
||||
property :description, :homepage, :version, :binary_url, :binary_sha1, :source_url, :source_sha1, :is_fake
|
||||
property :description, :homepage, :version, :binary_url, :binary_sha1, :binary_sha256, :source_url, :source_sha1, :source_sha256, :is_fake
|
||||
|
||||
class << self
|
||||
attr_reader :is_fake
|
||||
|
||||
Reference in New Issue
Block a user