diff options
| author | Jack Nagel | 2012-04-05 21:11:14 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2012-07-04 22:47:33 -0500 | 
| commit | 23c074206b0cf1751839550c8aed4a8d5f0be329 (patch) | |
| tree | 7118cb5ea2e77ff3a699dc9e946260c8bc0946c4 /Library/Homebrew/cmd/fetch.rb | |
| parent | cb94753b88b75c61cd780e37a5bfd28e7d076ed3 (diff) | |
| download | homebrew-23c074206b0cf1751839550c8aed4a8d5f0be329.tar.bz2 | |
fetch: make use of new formula specs
Diffstat (limited to 'Library/Homebrew/cmd/fetch.rb')
| -rw-r--r-- | Library/Homebrew/cmd/fetch.rb | 23 | 
1 files changed, 9 insertions, 14 deletions
| diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index bf7da0935..9e0dfbe9a 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -21,33 +21,28 @@ module Homebrew extend self      puts "Fetching: #{bucket * ', '}" if bucket.size > 1      bucket.each do |f| -      if ARGV.include? "--force" or ARGV.include? "-f" -        where_to = f.cached_download -        FileUtils.rm_rf where_to if File.exist? where_to -      end -        already_downloaded = f.cached_download.exist? +      f.cached_download.rmtree if already_downloaded and ARGV.force? +        the_tarball, _ = f.fetch        next unless the_tarball.kind_of? Pathname -      bottle = install_bottle? f - -      previous_md5 = f.instance_variable_get(:@md5).to_s.downcase unless bottle -      previous_sha1 = f.instance_variable_get(:@sha1).to_s.downcase -      previous_sha2 = f.instance_variable_get(:@sha256).to_s.downcase unless bottle +      previous_md5 = f.active_spec.md5.to_s.downcase +      previous_sha1 = f.active_spec.sha1.to_s.downcase +      previous_sha2 = f.active_spec.sha256.to_s.downcase        puts "Downloaded to: #{the_tarball}" unless already_downloaded -      puts "MD5:  #{the_tarball.md5}" unless bottle +      puts "MD5:  #{the_tarball.md5}"        puts "SHA1: #{the_tarball.sha1}" -      puts "SHA256: #{the_tarball.sha2}" unless bottle +      puts "SHA256: #{the_tarball.sha2}" -      unless previous_md5.nil? or previous_md5.empty? or the_tarball.md5 == previous_md5 or bottle +      unless previous_md5.nil? or previous_md5.empty? or the_tarball.md5 == previous_md5          opoo "Formula reports different MD5: #{previous_md5}"        end        unless previous_sha1.nil? or previous_sha1.empty? or the_tarball.sha1 == previous_sha1          opoo "Formula reports different SHA1: #{previous_sha1}"        end -      unless previous_sha2.nil? or previous_sha2.empty? or the_tarball.sha2 == previous_sha2 or bottle +      unless previous_sha2.nil? or previous_sha2.empty? or the_tarball.sha2 == previous_sha2          opoo "Formula reports different SHA256: #{previous_sha2}"        end      end | 
