diff options
| author | ilovezfs | 2016-09-04 11:28:38 -0700 |
|---|---|---|
| committer | ilovezfs | 2016-09-27 02:46:07 -0700 |
| commit | ce092d90fab059309775209f04c7a8a9f08b5688 (patch) | |
| tree | 4925cfee87e9981ae63802b9e0227d92d4e62876 /Library/Homebrew/dev-cmd | |
| parent | b432f8e9cb2d03c8f1d7a65b9d6df2e04b3d37a7 (diff) | |
| download | brew-ce092d90fab059309775209f04c7a8a9f08b5688.tar.bz2 | |
bump-formula-pr: set sha256 automatically when possible
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/bump-formula-pr.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index ce10da52a..5b3b4773d 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -89,7 +89,16 @@ module Homebrew elsif !hash_type odie "#{formula}: no tag/revision specified!" else - odie "#{formula}: no url/#{hash_type} specified!" + rsrc = Resource.new { @url = new_url } + rsrc.download_strategy = CurlDownloadStrategy + rsrc.owner = Resource.new(formula.name) + rsrc_path = rsrc.fetch + if Utils.popen_read("/usr/bin/tar", "-tf", rsrc_path) =~ /\/.*\./ + new_hash = rsrc_path.sha256 + else + odie "#{formula}: no url/#{hash_type} specified!" if new_url.include?(".tar") + new_hash = rsrc_path.sha256 + end end if ARGV.dry_run? |
